Skip to content

Instantly share code, notes, and snippets.

@misodengaku
Created June 17, 2013 04:25
Show Gist options
  • Select an option

  • Save misodengaku/5794645 to your computer and use it in GitHub Desktop.

Select an option

Save misodengaku/5794645 to your computer and use it in GitHub Desktop.
misod_000@miso-T430s ~ $ ./sosu kazu=>1 1 is prime misod_000@miso-T430s ~ $ ./sosu kazu=>1 1 is not prime
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i;
srand((unsigned int)time(NULL));
printf("kazu=>");
scanf("%d", &i);
if ((rand() % 2) == 1)
printf("%d is prime\n", i);
else
printf("%d is not prime\n", i);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment