Skip to main content
1 of 5

C (gcc), 119 bytes

#include <stdio.h> main(){int p;int f=1;int a;scanf("%d",&p);for(a=2;a<p;a++){f*=a;}printf("%d",p==0||p==1?1:(f+1)%p);} 

Outputs 0 (falsy) when it's prime and a truthy value when it's not.

My first C answer. To me, it's just a mix of Python and Assembly. Well, at least it's probably not as long as Java...

printf("Try it online!")