Program to check whether an input number is prime or not.

program:-

#include<stdio.h>
#inclue<conio.h>
void main()
{
int n,i;
printf (“Enter a number”);
scanf(“%d”,&n);
for(i=2;i<=n1,i++)
{
if(n%i==0)
break;
}
if(i==n)
printf(“number is prime number”);
else
printf (“not prime”);
getch();
}


7 thoughts on “Program to check whether an input number is prime or not.

Leave a Reply

Your email address will not be published.