#include<stdio.h>
void main()
{
int n,i,count=0;
scanf("%d",&n);
for(i=2;i<=n/2;i++)
{
if (n%i==0)
{
count=1;
break;
}
}
if(count==0)
{
printf("prime");
}
else
{
printf("non prime");
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter