63. WAP to check if the given number is prime number or not ( Part 2)
#include<stdio.h>
void
main()
{
int num,i,c=0;
printf("WAP to check if the given
number is prime number or not\n");
printf("Enter a number : ");
scanf("%d",&num);
for(i=2;i<num;i++)
{
if((num%i)==0)
c++;
}
if(c==0)
printf("Its a prime
number\n");
else
printf("Its not a prime
number\n");
}
Comments
Post a Comment