C++ Coding for (x*y)^(5/3)

Hi there Cplusplus users,

I am trying to input an equation which uses the pow (power)function.
I know that for x^5 the coding is: pow(x, 5)
However, the equation and coding I am inputting needs to include:

(x*y)^(5/3)

How do I enter (x*y)^(5/3) in the form of C++ code?
Thanks in advance.

James Cox
5/3 would perform integer division, so 5/3 is 1.
you'll need to make at least one of the operands a floating point number 5./3 (note the dot)
The exact code would be something like this:

 
std::pow(x*y,5.0/3.0);


Don't forget to #include <cmath> for the pow function.
Thanks ne555.
I noted the dot.

Thanks Shadowwolf for typing all the code out.
I'll make sure that I include #include <cmath>.
Topic archived. No new replies allowed.