Last active
December 26, 2015 13:19
-
-
Save weberhen/7157537 to your computer and use it in GitHub Desktop.
random C code with range passed as parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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