#include<stdio.h>
int prime(int);
int main()
{
int a,res,count=0;
printf("Enter any number:\t");
scanf("%d",&a);
res=prime(a);
if(count==2)
printf("\nPrime number");
else
printf("\nNOT A PRIME NUMBER");
}
int prime(int a)
{
int b,i,count=0;
for(i=1;i<=a;i++)
{
b=a%i;
}
if(b==0)
{
count++;
}
}
0 Comments