#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float a, b, h;
cout << "Enter a, b and h: ";
cin >> a >> b >> h;
float x = a;
float y;
int count = 0;
while (x <= b) {
y = x + sin(x);
cout << "x = " << x << "; y = " << y << endl;
if (y > 0) {
count++;
}
x = x + h;
}
cout << "count = " << count << endl;
getchar();
getchar();
return 0;
}
Перед публікацією, радимо ознайомиться з правилами!
Знайшли помилку?
Ви можете повідомити про це адміністрацію.
Виділіть текст і натисніть CTRL+Enter