#include<conio.h>//header file
#include<stdio.h>//header file
void main() //starting of the main() function
{
int i,flag=0,a;//declaration of the variables
clrscr();
printf("program that determines whether a given no. is prime or not");
printf("\n\n\n\t\t------------INPUT-------------");
printf("\n\nenter a no. to be checked prime or not");//taking input from the user
scanf("%d",&a);
for(i=2;i<a;i++)
{
if(a%i==0)
{
flag=1;
break;
}
}
printf("\n\n\n\t\t------------OUTPUT------------");
if(flag==0)
printf("\n\nit is a prime no."); //printing output
else
printf("\n\nit is not a prime no."); //printing output
getch();
}