#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,a;
cout<<"Enter any number:";
cin>>a;
for(i=2;i<a/2;i++)
if(a%i==0)
{
cout<<"Not a Prime number";
}
cout<<"Prime number";
getch();
}
#include<conio.h>
void main()
{
clrscr();
int i,a;
cout<<"Enter any number:";
cin>>a;
for(i=2;i<a/2;i++)
if(a%i==0)
{
cout<<"Not a Prime number";
}
cout<<"Prime number";
getch();
}
No comments:
Post a Comment