Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main ()
- {
- double a, b, x, y, Max;
- cout << "Input start point = ";
- cin >> a;
- cout << "Input finish point = ";
- cin >> b;
- Max = a*sin(a);
- for (x = a; x <= b; x += 0.001)
- {
- y = x *sin(x);
- if (y > Max)
- {
- Max = y;
- }
- }
- cout << "Max result: " << Max << endl;
- system ("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment