#include<stdio.h>
int main(void)
{
int num,i,flag=0;
printf("Input the num you want to judge\n");
scanf("%d",&num);
for(i=2;i<num;i++)
if(num%i==0)
{ flag=1; break;
}
if(!flag)
printf("YES\n");
else
printf("NO\n");
}
#include "stdio.h"
#include "math.h"
void main()
{ int m,i,k; scanf("%d",&m); k=sqrt(m); for(i=2;i<=k;i++) if(m%i==0)break; if(i>k)printf("%d is a prime number\n",m); else printf("%d is not a prime number\n",m);
}