#include<conio.h>
#include<process.h>
main()
{
int i,n;
clrscr();
printf("Enter number...");
scanf("%d",&n);
for(i=2;i<=n/2;i++)
{
if(n%i==0)
{
printf("Not Prime");
getch();
exit(0);
}
}
printf("Prime ");
getch();
}
its to easy way……………
Yes!
Check these other programs on PRIME numbers…
http://blog.kodegod.com/?s=prime
above prime no program not give a right result because of absence n—;
It would as it’s just checking whether the number is prime or not