fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main()
  5. {
  6. int x=0;
  7. int q=0;
  8. int a[]={-5,-4,-3,-2,-1,0,1,2,3,4};
  9. for ( int i = 0; i < 9; i++)
  10. {
  11. int x = a[i];
  12. q=(pow(x, 3)+3(pow(x, 2))+atan(x);
  13. cout << "B= " << q << endl;
  14. }
  15. int b = 2.8;
  16. x=b;
  17. q=x^3+3(x^2)+atan(x); cout << "B= " << q << endl;
  18. int c = 3.2;
  19. x=c;
  20. q=x^3+3(x^2)+atan(x); cout << "B= " << q << endl;
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:26: error: expression cannot be used as a function
  q=(pow(x, 3)+3(pow(x, 2))+atan(x);
                          ^
prog.cpp:12:35: error: expected ‘)’ before ‘;’ token
  q=(pow(x, 3)+3(pow(x, 2))+atan(x);
                                   ^
prog.cpp:17:13: error: expression cannot be used as a function
  q=x^3+3(x^2)+atan(x); cout << "B= " << q << endl;
             ^
prog.cpp:20:13: error: expression cannot be used as a function
  q=x^3+3(x^2)+atan(x); cout << "B= " << q << endl;
             ^
stdout
Standard output is empty