Answer to Question #310821 in C++ for Diya

Question #310821

3. Write a program that asks the user to enter a value for x and then displays the value of the following polynomial 2x^5+3x^4-x^3-2x^2+7x-

1
Expert's answer
2022-03-13T11:22:25-0400
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	float x;
	cout <<"Please, enter a value of x: ";
	cin >> x;
	cout << "2x^5 + 3x^4 - x^3 - 2x^2 + 7x = "
		<< 2 * pow(x, 5) + 3 * pow(x, 4) - pow(x, 3) - 2 * pow(x, 2) + 7 * x;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment