fork download
  1. #include <stdio.h>
  2. #define LEFT -2
  3. #define RIGHT 2.5
  4.  
  5. double F1(double x)
  6. {
  7.   return x*x;
  8. }
  9.  
  10. double F2(double x)
  11. {
  12.   return (5+x/2);
  13. }
  14.  
  15. int main()
  16. {
  17. double x=LEFT,sum=0,step;
  18. step=(RIGHT-LEFT)/100;
  19.  
  20. while(x<RIGHT)
  21. {
  22.   sum+=step*(F2(x+step/2)-F1(x));
  23.   x+=step;
  24. }
  25.  
  26. printf("\nSum = %f",sum);
  27.  
  28. return 0;
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Free Pascal Compiler version 3.0.4+dfsg-22 [2019/01/24] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling prog.pas
prog.pas(1,1) Error: Illegal char constant
prog.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string" found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
stdout
Standard output is empty