is this illegeal??

so, in my program, I must use an equation--- where the "total" is equal to "p" times "e"with the power of "r"times "t".

How would I print that?

Can I print it like this---
total = p * pow(pow(e,r),t)

?

is that correct or wrong?

help please :o
Illegal?
1
2
3
#include <cmath>

total = p * pow(e, (r * t));


This assuming you are trying to write out: total = p * e^(r * t).

If you are saying it as total = p * (e ^ r) * t, then it would be much more readable to say total = p * t * e ^ r. In that case:

total = p * t * pow(e, r);
yes, i am trying to print
total = p * e^(r * t).

i was correct! thank you so much!
Topic archived. No new replies allowed.