#include

#include

using namespace std;

enum Boolean{FALSE,TRUE};

Boolean ispal(int a)

{

int num=a;

int digit=0,rev=0;

while(a>0)

{

digit=a%10;

rev=rev*10+digit;

a=a/10;

}

if(num==rev)

return TRUE;

else

return FALSE;

}

Boolean isprime(int n)

{

int flag=0;

for(int i=1;i<=n/2;i++)

{

if((n%i)==0)

flag++;

}

if(flag>1)

return FALSE;

else

return TRUE;

}

int main()

{

int input, output;

cin>>input;

for(long int i=input+1;i<10000000;i++)

{

if(isprime(i))

{

if(ispal(i))

{

cout<<i;

exit(0);

}

else

continue;

}

continue;

}

return 0;

}

This is the code that i submitted, and for 31 i am getting 101. but upon submission, i’m told that the answer is wrong, could someone please point out the error in the code?