fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int get min (int set []
  5. {int 1, min;
  6. min=set[0];
  7. i=1;
  8. while (i<3)})
  9. {
  10. if (min<set[i])
  11. min=set[i];
  12. }
  13. i=i+1;
  14. }return min;
  15. }
  16. main ()
  17. {
  18. int set1[3] = {2,4,1};
  19. int set 2[3] = {6,5,4};
  20. int min;
  21. /*process first set of numbers*/
  22. min=get min (set 1);
  23. printf ("min in first set = %d\n", min)
  24. }
  25. }
  26. return 0;
  27. }
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'min'
 int get min (int set []
         ^
prog.c:4:9: warning: implicit declaration of function 'min' [-Wimplicit-function-declaration]
prog.c:4:14: error: expected expression before 'int'
 int get min (int set []
              ^
prog.c:9:1: error: expected ';' before '{' token
 {
 ^
prog.c: At top level:
prog.c:14:2: error: expected identifier or '(' before 'return'
 }return min;
  ^
prog.c:15:1: error: expected identifier or '(' before '}' token
 }
 ^
prog.c:16:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main ()
 ^
prog.c:16:1: error: redefinition of 'main'
prog.c:3:5: note: previous definition of 'main' was here
 int main(void) {
     ^
prog.c: In function 'main':
prog.c:19:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
  int set 2[3] = {6,5,4};
          ^
prog.c:19:11: error: subscripted value is neither array nor pointer nor vector
  int set 2[3] = {6,5,4};
           ^
prog.c:19:17: error: expected expression before '{' token
  int set 2[3] = {6,5,4};
                 ^
prog.c:22:6: error: 'get' undeclared (first use in this function)
  min=get min (set 1);
      ^
prog.c:22:6: note: each undeclared identifier is reported only once for each function it appears in
prog.c:22:10: error: expected ';' before 'min'
  min=get min (set 1);
          ^
prog.c:24:1: error: expected ';' before '}' token
 }
 ^
prog.c:18:6: warning: unused variable 'set1' [-Wunused-variable]
  int set1[3] = {2,4,1};
      ^
prog.c: At top level:
prog.c:25:1: error: expected identifier or '(' before '}' token
 }
 ^
prog.c:26:2: error: expected identifier or '(' before 'return'
  return 0;
  ^
prog.c:27:1: error: expected identifier or '(' before '}' token
 }
 ^
stdout
Standard output is empty