how would you type this equation

How would i write this equation in c++

z = (1 + (x/12)) ^ (12 * y)

i wrote it as

1
2
3

 z = (1 + (x / 12)) * pow(12, y)


something about it seems off to me. So i just want to check to make sure i wrote it right
thank you!
z = std::pow(1 + (x / 12.0), 12 * y)

It's a nice exercise to write a program to do this transformation....
Last edited on
Thank you!! i knew there was something off about it.

Just remember to be very strict with programming, use your BEDMAS rules and always use brackets to explain what actions should be performed in what sequence.
Topic archived. No new replies allowed.