How many five-digit primes have exactly one zero as a digit?
For example, 984 0 7 is one such prime.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The following C program will find and count all such prime numbers, #include<stdio.h> int checkprime(int); main() { int j=0,flag2,i,k,c; for(k=10000;k<=99999;k++) { c=checkprime(k); if(c==1) { flag2=0; i=k; while(i) { c=i\%10; i=i/10; if(c==0) { flag2++; } } if(flag2==1) { printf("\%d\n",k); j++; } } } printf("\nNo.of such numbers is \%d\n",j); } int checkprime(int a) { int i,flag=0,c; for(i=2;i<=(a/2);i++) { if(a\%i==0) { flag=1; return 0; } } if(flag==0) return 1; }