THE 'C'- ARCHIE STYLE...
Thursday, March 31, 2011
Number is Prime or not
void main()
{
int n,i,a;
clrscr();
printf("enter the no.");
scanf("%d",&n);
for(i=2;i<n;i++)
{
a=n % i;
if(a==0)
{
printf("not prime");
break;
}
}
if(i==n)
printf("prime no.");
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment