#include<iostream>
#include<cmath>
#include<string>usingnamespacestd;floatsimple_interest(floata,floatb,intc){floatsi=(a*b*c)/100;returnsi;}floatcompound_interest(floatx,floaty,intz){floatci=x*pow((1+y/100),z)-x;returnci;}intmain(){floatp,r;intt;stringm;cout<<"Enter your Principal Amount: ";cin>>p;cout<<"Enter your Rate of Interest: ";cin>>r;cout<<"Enter your Time: ";cin>>t;cout<<"****************"<<endl;cout<<"Type of Interest(s for SI and c for CI): ";cin>>m;if(m=="c"){cout<<"Compound Interest is: "<<compound_interest(p,r,t);}elseif(m=="s"){cout<<"Simple Interest is: "<<simple_interest(p,r,t);}else{cout<<"Please select between SI & CI";};return0;}

Top comments (0)

Subscribe

For further actions, you may consider blocking this person and/or reporting abuse

## Top comments (0)