C Program to find a number is prime or not - c programs
//write a c program to find a number is prime or not
//Check a number is prime or not in / using c program
//C Program to find a number is prime or not
#include<stdio.h>
void main()
{
int number,i,ifprime;
for (number=2;number<=100;number++)
{
for (i=2; i<number; i++)
{
if (i%div==0)
{
ifprime=0;
break;
}
ifprime=1;
}
if (ifprime)
{
printf(" \n prime number %d",number);
}
}
}
No comments:
Post a Comment