#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
clrscr();
printf("\n enter the value of num");
scanf("\n %d",&num);
for(i=2;i<num;i++)
{
if(num%i==0)
{
break;
}
}
if(num==i)
{
printf("\n number is prime");
}
else
{
printf("\n number is not prime");
}
getch();
}
#include<conio.h>
void main()
{
int num,i;
clrscr();
printf("\n enter the value of num");
scanf("\n %d",&num);
for(i=2;i<num;i++)
{
if(num%i==0)
{
break;
}
}
if(num==i)
{
printf("\n number is prime");
}
else
{
printf("\n number is not prime");
}
getch();
}