Computer Science, asked by haxer, 1 year ago

For the following equation 3x^4 + 4x^3 + x^2 + 7x + 9, how can i substitute the user provided value of x and generate the result in c++?

Answers

Answered by Arya18Pandey
0
first ask the user for a value
cout<<"enter a number of your choice";

then accept the value

cin>>x;

then calculate the value

...
#include
{
int x;
cout<<"enter a number of your choice";
cin>>x;
cout<<3*x^4+.....(full quation);
getch();
}

hope this helps

Arya18Pandey: u would also need another header file..
Arya18Pandey: #include
Arya18Pandey: <....conio.h..>
Arya18Pandey: just ignore these dots...as if i dont type with them...they wont get displayed
haxer: i have added both header files properly still getting error
Arya18Pandey: ok ..have u written x^4....instead of x*x*x*x...because c++ doesnt understand ^ this sign...
Arya18Pandey: and equation should be written in this manner....3*x*x*x*x+4*x*x*x....
haxer: i am getting these error
C1003
haxer: C2039 C3861 C2039 lots of errors like this
Arya18Pandey: can u send a pic of the compilation that u have typed on the compiler
Similar questions