fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(void)
  6. {
  7. int a,i;
  8. srand((unsigned int)time(0));
  9. for (i = 0; i < 20; i++) {
  10. a = (int)((rand() / ((double)RAND_MAX+1.0)) * 10);
  11. printf("%d ", a);
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0.02s 1720KB
stdin
Standard input is empty
stdout
1 4 3 9 6 8 2 5 4 1 2 9 8 3 7 1 5 0 1 5