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 - The Fusion of Science and Community**

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

Loading...

Similar Threads for Function prototype | Date |
---|---|

C/++/# Is Pass-by-Reference part of a Function Signature? | Mar 2, 2018 |

Fortran Fortran external functions vs subroutines | Oct 17, 2017 |

How to plot generalized hypergeometric function in ROOT? | May 4, 2017 |

C/++/# Functions and Return statement in C | May 3, 2017 |

**Physics Forums - The Fusion of Science and Community**