#include<iostream.h>
#include<conio.h>
void main()
{
int i=1,k=0,n;
clrscr();
cout<<"enter the number";
cin>>n;
while(i<=n)
{
if(n%i==0)
k=k+1;
i++;
}
if(k==2)
cout<<"prime number";
else
cout<<"not a prime number";
getch();
}
OUT PUT
If U LIKE THE POST FOLLOW THE BLOG
No comments:
Post a Comment