Program To Check Whether The Entered Number Is Prime Or Not
/* Program To Check Whether The Entered Number Is Prime Or Not */ #include
#include
void main() { int n,i=1,c=0; clrscr(); printf("\nEnter a number\n\n"); scanf("%d",&n); while(i<=n) { if((n%i)==0) c++; i++; } if(c!=2) printf("\n%d is not a prime number",n); else printf("\n%d is a prime number",n); getch(); }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/