Back To C++ User Defined Functions Index
//program to create a function to calculate simple interest based on principal amount,rate of interest and time (principal,rate and time are passed to functions as arguments, principal and rate are passed as float arguments , time is passed as integer argument ) #include
#include
void calsi(float,float,int); void calcsi(float principal,float rate,int time) { float si; si=(principal*rate*time)/100; cout<<"simple interest is "<
>p; cout<<"enter rate of interest"; cin>>r; cout<<"enter time in years"; cin>>t; calcsi(p,r,t); getch(); }