fork download
  1. #include <time.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7. int A[75];
  8. int min = 0, max = 0;
  9. srand(time(NULL));
  10. for (int i = 0; i<75; i++)
  11. A[i]= rand() % 25 - 5;
  12. for (int i = 0; i<75; i++)
  13. {
  14. if (A[i] > max)
  15. max = A[i];
  16. if (A[i] < min)
  17. min = A[i];
  18. }
  19.  
  20. printf("%d %d", min, max);
  21. return 0;
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:10:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i<75; i++)
  ^
prog.c:10:2: note: use option -std=c99 or -std=gnu99 to compile your code
prog.c:12:11: error: redefinition of ‘i’
  for (int i = 0; i<75; i++)
           ^
prog.c:10:11: note: previous definition of ‘i’ was here
  for (int i = 0; i<75; i++)
           ^
prog.c:12:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i<75; i++)
  ^
stdout
Standard output is empty