fork download
  1. #include <iostream> // func.cpp
  2. #include <cmath> // rextester.com/EKC21250
  3. using namespace std;
  4.  
  5. double func(double x)
  6. { double rad,a,b,c,d,e,f,func;
  7. rad = x * M_PI / 180;
  8. a = pow(x, 1/4);
  9. b = sqrt(x); // cout << b << endl;
  10. c = cos(rad); cout << c << endl;
  11. d = log10(x); // cout << d << endl;
  12. e = exp(b);
  13. f = log10(b) * log(e);
  14. func = a + b + c + d + e + f;
  15. return func;
  16. }
  17.  
  18. int main()
  19. { double x = 90.;
  20. cout << x << " " << func(x) << endl;
  21. system("pause");
  22. }
  23.  
Success #stdin #stdout #stderr 0.01s 5284KB
stdin
Standard input is empty
stdout
90     6.12323e-17
13206.7
stderr
sh: 1: pause: not found