Quick actions

cmd+k|ctrl+k

Navigation

Languages

task 250

Snippet info

Language

Cpp

Visibility

public

Author

serbon95

Created

2020-11-14T18:28:53Z

Updated

2020-11-14T18:28:53Z

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

int main()
{
	double x, y, a, b, xn = 1, xk = 5, step = 0.5; //40 не подходит
	cout << "Task 250"<< endl;
	cout << "y = a * x^2 + b     (a = 3; b = -5)" << endl;
	cout << "|     x      |     y     |"<< endl;
	
	for (x = xn; x <= xk; x += step)
	{
		a = 3; b = -5;
		y = a * (x * x) + b;
		cout << setw(8) << x << setw(12) << y << endl;
	}

}
INFO