An Interest In:
Web News this Week
- March 6, 2024
- March 5, 2024
- March 4, 2024
- March 3, 2024
- March 2, 2024
- March 1, 2024
- February 29, 2024
September 25, 2022 08:13 am GMT
Original Link: https://dev.to/madhubankhatri/interest-calculator-in-c-52k1
Interest Calculator In C
Interest calculator System in C++
#include<iostream>#include<cmath>#include<string>using namespace std;float simple_interest(float a, float b, int c){ float si = (a*b*c)/100; return si;}float compound_interest(float x, float y, int z){ float ci = x*pow((1+y/100),z)-x; return ci;}int main(){ float p, r; int t; string m; 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); } else if(m=="s"){ cout<<"Simple Interest is: "<<simple_interest(p,r,t); } else{ cout<<"Please select between SI & CI"; }; return 0;}
Original Link: https://dev.to/madhubankhatri/interest-calculator-in-c-52k1
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To