#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
clrscr();
printf("Enter the number = ");
scanf("%d",&num);
i=2;
while (i<=num-1)
{
if (num%i==0)
{
printf("%d is not a prime number",num);
break;
}
i++;
}
if (i==num)
{
printf("%d is a Prime Number",num);
}
getch();
}
0 Comments:
Post a Comment