Back To C++ User Defined Functions Index
//program to create a function that calculates compound interest based on principal amount, rate of interest and time passed to the function as arguments #include
#include
#include
void compoundi(float principal,float rate,float time); void compoundi(float principal,float rate,float time) { float ci; ci=(principal*pow(1+(rate/100),time)); cout<<"\ncompound interest is "<
>principal; cout<<"\nenter rate of interest "; cin>>rate; cout<<"\nenter time "; cin>>time; compoundi(principal,rate,time); getch(); }