найти значение функции , если x изменяется от 3 до -4 с шагом -0,5, применяя цикл с постусловием
Приложения:

Ответы на вопрос
Ответил Milton812
0
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "RUSSIAN");
cout << "y=(1+sin x)/(2-x)" << endl;
cout << setw(5) << 'x' << setw(10) << 'y' << endl;
float x = 3;
float y;
do
{
y = (1 + sin(x)) / (2 - x);
cout << setprecision(2) << setw(5) << x << setw(10) << y << endl;
x = x - 0.5;
} while (x >= -4);
system("pause");
}
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
setlocale(LC_ALL, "RUSSIAN");
cout << "y=(1+sin x)/(2-x)" << endl;
cout << setw(5) << 'x' << setw(10) << 'y' << endl;
float x = 3;
float y;
do
{
y = (1 + sin(x)) / (2 - x);
cout << setprecision(2) << setw(5) << x << setw(10) << y << endl;
x = x - 0.5;
} while (x >= -4);
system("pause");
}
Ответил sadpepe1
0
нужен Pascal
Новые вопросы