fork(3) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <time.h>
  5.  
  6. int random(int low, int high) {
  7. return rand() % (high - low + 1) + low;
  8. }
  9.  
  10. int main(void)
  11. {
  12. srand(time(0));
  13. for(int i = 0; i < 30; ++i)
  14. printf("%d\n", random(15, 50));
  15. return 0;
  16. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
49
50
31
36
32
27
21
23
50
44
18
27
39
28
16
38
15
32
49
37
17
24
43
21
30
43
49
46
38
48