#include<stdio.h>
#include<conio.h>
main()
{
int i,num;
clrscr();
printf("\n enter the number num");
scanf("\n %d",&num);
i=2;
while(i<=num-1)
{
if(num%2==0)
{
printf("\n num is not prime");
break;
}
i++;
}
if(i==num)
{
printf("\n num is prime");
}
return (0);
}
output:-
*enter the num-23
num is prime.
*enter the num-118
num is not prime.