- #include"stdio.h"
- #define PERIOD 10
- #define PRINCIPAL 5000.00
- main()
- {
- int year;
- float amount, value, inrate;
- amount = PRINCIPAL;
- inrate = 0.11;
- year = 0;
- while(year <= PERIOD)
- {
- printf("%2d %8.2f\n", year, amount);
- value = amount + inrate * amount;
- year = year + 1;
- amount = value;
- }
- }
The output after the execution will be :
0 5000.00
1 5550.00
2 6160.50
3 68.38.15
.
.
.
.
10 14197.11
0 comments:
Post a Comment