read more...
post by sanjay Vishwakarma
Sunday, October 3, 2010
write a program for accept the number from user and find is number are prime or not ?
#include
#include
void main()
{
int n,a,c=0;
clrscr();
printf("Enter number to be checked\n");
scanf("%d",&n);
for(a=2;a
{
if(n%a==0)
c++;
}
if(c>0)
printf("Not a prime number\n");
else printf("Prime number\n");
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment