I am a beginner trying to enter a function prototype into C++. This is what I have entered....where am I going wrong?(adsbygoogle = window.adsbygoogle || []).push({});

double f(double x)

{

return 5*pow(x,3)-3*pow(x,2)+2*x+1;

}

I would like to be able to enter something like f(2.4) later in the code, and have it calculate the value using this function. How would I do this?

f(x)=5x^{3}-3x^{2}+2x+1

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Function prototype

**Physics Forums | Science Articles, Homework Help, Discussion**