Skip to content

Instantly share code, notes, and snippets.

@ntddk
Created September 18, 2014 18:57
Show Gist options
  • Save ntddk/b7e15a93982cb102e7bd to your computer and use it in GitHub Desktop.
Save ntddk/b7e15a93982cb102e7bd to your computer and use it in GitHub Desktop.
n;f;i;main(){scanf("%d",&n);printf("%d ",n);if(n<=1)f=1;for(i=2;++i<=n/2;){if(n%i==0)f=1;break;}printf((f==0)?"is a prime number":"is not a prime number");}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment