C Program For Prime Number
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
// Progrtam for prime number
#include<stdio.h>
#include<conio.h>
int main()
{
int n,i=2,f=0;
printf("Enter a number");
scanf("%d",&n);
while(i<n-1)
{
if(n%i==0)
{
f=1;
break;
}
i++;
}
if(f==0)
printf("\nNo is prime");
else
printf("\nNo is not prime");
}
We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

