#include<conio.h>
#include<stdio.h>
void main()
{
int n,i,k;
clrscr();
printf("\n Enter any number");
scanf("%d",&n);
i=1;
k=0;
while(i<=n)
{
if(n%i==0)
{
k++;
if(k>2)
{
printf("\n Enterd number %d is not prime number",n);
break;
}
}
i++;
}
if(k<=2)
{
printf("\n Enterd number %d is prime number",n);
}
getch();
}
No comments:
Post a Comment