Ravenbvutt

Untitled

Oct 8th, 2017
11,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main ()
  5. {
  6. double a, b, x, y, Max;
  7. cout << "Input start point = ";
  8. cin >> a;
  9. cout << "Input finish point = ";
  10. cin >> b;
  11.  
  12. Max = a*sin(a);
  13.  
  14. for (x = a; x <= b; x += 0.001)
  15. {
  16. y = x *sin(x);
  17. if (y > Max)
  18. {
  19. Max = y;
  20. }
  21. }
  22. cout << "Max result: " << Max << endl;
  23. system ("pause");
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment