Skip to content

Instantly share code, notes, and snippets.

@weberhen
Last active December 26, 2015 13:19
Show Gist options
  • Save weberhen/7157537 to your computer and use it in GitHub Desktop.
Save weberhen/7157537 to your computer and use it in GitHub Desktop.
random C code with range passed as parameter
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char**argv)
{
srand (time(NULL));
printf("%d",rand()%atoi(argv[1]));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment