Ask a Teacher



write a c++ program to calculate simple interest and compound interest. explain it.

#include <iostream.h>
# include <math.h>
int main()
{
int P,R,T,SI,CI;   
cout<<"Enter the PrincipalAmount ,Time period & Interest rate";
cin>>P>>R>>T;
SI=(P*R*T*)/100;
CI=P*(pow(1+R/100),T);
cout<<"The S I is"<<SI<<endl;
cout<<"The C I is"<<CI<<endl;
return 0;
}


comments powered by Disqus