fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(void) {
  6. int r;
  7. srand(time(NULL));
  8. printf("1: %d / %d\n", rand(), RAND_MAX);
  9. printf("2: %d / %d\n", rand(), RAND_MAX);
  10. printf("3: %d / %d\n", rand(), RAND_MAX);
  11. return 0;
  12. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
1: 1988843793 / 2147483647
2: 1314756924 / 2147483647
3: 1405433647 / 2147483647