Quick actions

cmd+k|ctrl+k

Navigation

Languages

Task 110

Snippet info

Language

Cpp

Visibility

public

Author

serbon95

Created

2020-11-14T17:59:45Z

Updated

2020-11-14T17:59:45Z

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	double x, y, xn = 0, xk = 40, step = 1; //40 не подходит
	cout << "Task 110"<< endl;
	cout << "y = x * x + x + 41     (0 <= x <= 40)" << endl;
	cout << "|     x      |     y     |"<< endl;
	
	for (x = xn; x <= xk; x += step)
	{
		y = x * x + x + 41;
		cout << setw(10) << x << setw(10) << y << endl;
	}

	cout << "если X = 40, то  Y не натуральное число!" << endl;
}
INFO