Advertisement
Ravenbvutt

Untitled

Sep 30th, 2017
10,572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 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.  
  13. for (x = a; x <= b; x += 0.001)
  14. {
  15. y = x *sin(x);
  16. if (y > Max)
  17. {
  18. Max = y;
  19. }
  20. }
  21. cout << "Max result: " << Max << endl;
  22. system ("pause");
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement