View Code of Problem 92

#include<stdio.h>
int main(){
	int m,n;
	int i,j,s,a;
	int isprime;
	int num=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++){
		s=i;
		a=0;
		while(s>0){
			a=a*10+s%10;
			s=s/10;
		}
		if(i==a){
			isprime=0;
			for(j=2;j<a;j++){
				if(a%j==0){
					isprime=1;
					break;
				}
			}
			if(isprime==0){
				num++;
				printf("%6d",i);
				if(num%5==0)
				printf("\n");
			} 
		}
		
		
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 92