yearly interest calculator c 2b 2b using for loop

Solutions on MaxInterview for yearly interest calculator c 2b 2b using for loop by the best coders in the world

showing results for - "yearly interest calculator c 2b 2b using for loop"
Fabian
01 Oct 2019
1#include <iostream>
2#include <cmath>
3#include <iomanip>
4using namespace std;
5
6void main()
7{
8// Inputs //
9
10double princ = 0.0;
11double rate = 0.0;
12int years = 0;
13int year = 1;
14double total = 0.0;
15
16// Ask User For INFO //
17
18cout << "What is the principle? ";
19cin >> princ;
20cout << "What is the rate in decimal? ";
21cin >> rate;
22cout << "how many years? ";
23cin >> years;
24
25
26
27for (double total; total = princ*(1+rate)*year;)
28{
29cout << "The balance after year " << year << " is "<< total << endl << endl;
30year += 1;
31}
32
33while((years + 1)!= year);
34
35system("pause");
36}
37
similar questions