Jarvis
Jarvis

Reputation: 17

How do you use the power function in c++ with 3 parts?

I need help with this a growth/decay equation.

answer = principle * pow(2.7,rate,number));

That is the code I have for that line and I want to calculate this equation as...

answer = principle * 2.7^(rate*number)

I am getting an error that pow function won't work for this scenario. Please note that I am using...

 #include <cmath>

Error:

.\Lab2.cpp(27): error C2661: 'pow': no overloaded function takes 3 arguments

Thanks

Upvotes: 0

Views: 97

Answers (1)

Bob Bobby
Bob Bobby

Reputation: 134

auto answer = principle * pow(2.7, rate * number);

Upvotes: 2

Related Questions