Code Snippets C

#include
int main(void)
{
int num, j, is_prime;
printf("Enter a number: ");
scanf("%d", &num);
is_prime = 1;
for(j = 2; j <= num / 2; j = j + 1)
if((num%j)==0)
is_prime = 0;
if(is_prime==1)
printf(" is prime.");
else
printf("not prime.");
return 0;
}