Skip to content

Instantly share code, notes, and snippets.

@cldotdev
Created January 5, 2014 08:03
Show Gist options
  • Select an option

  • Save cldotdev/8265661 to your computer and use it in GitHub Desktop.

Select an option

Save cldotdev/8265661 to your computer and use it in GitHub Desktop.
Generate random number in C
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main()
{
srand(time(NULL));
int r = rand();
printf("%d\n", r);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment