#include <stdio.h>
int main()
{
int num;
int ctr;
int count=0;
printf("Enter the number\n");
scanf("%d",&num);
for(ctr=2;ctr<num;ctr++)
{
if((num%ctr)==0)
{
count++;
}
}
if(count==0)
{
printf("The number is a prime number\n");
}
else
{
printf("The number is not a prime number\n");
}
return 0;
}
No comments:
Post a Comment