fork download
  1. #include <stdio.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6.  
  7. {
  8. printf(" A, B, VAL: real;")
  9. function MAIOR( X , Y : real ) : real;
  10. int main ()
  11. if ( X > Y) then
  12. MAIOR := X
  13. else
  14. MAIOR := Y;
  15. return;
  16. }
  17. {
  18. int main()
  19. printf("Entre com um valor: ");
  20. scanf(A);
  21. write("Entre com um valor: ");
  22. scanf(B);
  23. VAL := MAIOR(A,B);
  24. printf("Maior: ', VAL ");
  25. return;
  26. }
  27. function L6P14;
  28. A = input("Entre com um valor: ");
  29. B = input("Entre com um valor: ");
  30. printf(1,"Maior: %f\n', MAIOR(A,B) ");
  31. function RET = MAIOR( X , Y );
  32. if ( X > Y )
  33. RET = X;
  34. else
  35. RET = Y;
  36.  
  37.  
  38. return 0;
  39. }
  40.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:1: error: expected ‘;’ before ‘function’
 function MAIOR( X , Y : real ) : real;
 ^~~~~~~~
prog.c:10:5: warning: ‘main’ is normally a non-static function [-Wmain]
 int main ()
     ^~~~
prog.c: In function ‘main’:
prog.c:11:1: error: expected declaration specifiers before ‘if’
 if ( X > Y) then
 ^~
prog.c:15:1: error: expected declaration specifiers before ‘return’
 return;
 ^~~~~~
prog.c:16:1: error: expected declaration specifiers before ‘}’ token
 }
 ^
prog.c:18:6: warning: ‘main’ is normally a non-static function [-Wmain]
  int main()
      ^~~~
prog.c: In function ‘main’:
prog.c:19:1: error: expected declaration specifiers before ‘printf’
 printf("Entre com um valor: ");
 ^~~~~~
prog.c:20:1: error: expected declaration specifiers before ‘scanf’
 scanf(A);
 ^~~~~
prog.c:21:1: error: expected declaration specifiers before ‘write’
 write("Entre com um valor: ");
 ^~~~~
prog.c:22:1: error: expected declaration specifiers before ‘scanf’
 scanf(B);
 ^~~~~
prog.c:23:1: error: expected declaration specifiers before ‘VAL’
 VAL := MAIOR(A,B);
 ^~~
prog.c:24:1: error: expected declaration specifiers before ‘printf’
 printf("Maior: ', VAL ");
 ^~~~~~
prog.c:25:1: error: expected declaration specifiers before ‘return’
 return;
 ^~~~~~
prog.c:26:1: error: expected declaration specifiers before ‘}’ token
 }
 ^
prog.c:27:1: error: unknown type name ‘function’
 function L6P14;
 ^~~~~~~~
prog.c:28:1: error: expected declaration specifiers before ‘A’
 A = input("Entre com um valor: ");
 ^
prog.c:29:1: error: expected declaration specifiers before ‘B’
 B = input("Entre com um valor: ");
 ^
prog.c:30:1: error: expected declaration specifiers before ‘printf’
 printf(1,"Maior: %f\n', MAIOR(A,B) ");
 ^~~~~~
prog.c:31:1: error: unknown type name ‘function’
 function RET = MAIOR( X , Y );
 ^~~~~~~~
prog.c:31:1: error: parameter ‘RET’ is initialized
prog.c:31:16: warning: implicit declaration of function ‘MAIOR’ [-Wimplicit-function-declaration]
 function RET = MAIOR( X , Y );
                ^~~~~
prog.c:31:23: error: ‘X’ undeclared (first use in this function)
 function RET = MAIOR( X , Y );
                       ^
prog.c:31:23: note: each undeclared identifier is reported only once for each function it appears in
prog.c:31:27: error: ‘Y’ undeclared (first use in this function)
 function RET = MAIOR( X , Y );
                           ^
prog.c:32:1: error: expected declaration specifiers before ‘if’
 if ( X > Y )
 ^~
prog.c:34:1: error: expected declaration specifiers before ‘else’
 else
 ^~~~
prog.c:38:1: error: expected declaration specifiers before ‘return’
 return 0;
 ^~~~~~
prog.c:39:1: error: expected declaration specifiers before ‘}’ token
 }
 ^
prog.c:31:10: error: declaration for parameter ‘RET’ but no such parameter
 function RET = MAIOR( X , Y );
          ^~~
prog.c:27:10: error: declaration for parameter ‘L6P14’ but no such parameter
 function L6P14;
          ^~~~~
prog.c:39:1: error: expected ‘{’ at end of input
 }
 ^
prog.c: In function ‘main’:
prog.c:39:1: error: expected declaration or statement at end of input
prog.c: In function ‘main’:
prog.c:39:1: error: expected declaration or statement at end of input
prog.c:39:1: error: expected declaration or statement at end of input
At top level:
prog.c:10:5: warning: ‘main’ defined but not used [-Wunused-function]
 int main ()
     ^~~~
prog.c:18:6: warning: ‘main’ defined but not used [-Wunused-function]
  int main()
      ^~~~
stdout
Standard output is empty