#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
bool flag=true;
printf(“Enter any
number”);
scanf(“%d”,&num);
for(i=2;i<=(num/2);++i)
{
if(num%i==0)
{
flag=false;
break;
}
}
if(flag==flase)
printf(“Number
is not Prime”);
else
printf(“Number
is Prime”);
getch();
}
OUTPUT :
Enter any number 5
Number is Prime
0 comments:
Post a Comment