#include <stdio.h>
void main()
{
int i,j,k,s,t,n,c;
printf("Follow is output:\n");
for(i=0;i<=9;i++)
for(j=0;j<=9;j++)
for(k=0;k<=9;k++)
{
s=i*100+j*10+k;
t=k*100+j*10+i;
if(i==0&&j==0)
t/=100;
else if(i==0)
t/=10;
for(c=2;c<s/2;c++)
if(s%c==0)
{
n=0;
break;
}
else
n=1;
if(s>10&&s==t&&n)
printf("%d\t",s);
}
}
void main()
{
int i,j,k,s,t,n,c;
printf("Follow is output:\n");
for(i=0;i<=9;i++)
for(j=0;j<=9;j++)
for(k=0;k<=9;k++)
{
s=i*100+j*10+k;
t=k*100+j*10+i;
if(i==0&&j==0)
t/=100;
else if(i==0)
t/=10;
for(c=2;c<s/2;c++)
if(s%c==0)
{
n=0;
break;
}
else
n=1;
if(s>10&&s==t&&n)
printf("%d\t",s);
}
}