when i change formula from SI to CI , it shows error
I changed the formula fro SI to CI and it's not working
#include
using namespace std;
int main(){
// compound interst//
int p,r,t;
float ci;
cin>>p>>r>>t;
ci=p(1+r/100.0)^t;
cout<<ci<<endl;
return 0;
}
to compute exponent use pow funtion
^ operator is not for power in c++.
if u want to calculate a ^ b then in c++ it should be pow(a,b)
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.