14. Write a program that calculates how much money you'll end up with if you invest an amount of money at a fixed interest rate, compounded yearly. Have the user furnish the initial amount, the number of years, and the yearly interest rate in percent. Some interaction with the program might look like this:

15. Enter initial amount: 3000

16. Enter number of years: 10

17. Enter interest rate (percent per year): 5.5

At the end of 10 years, you will have 5124.43 dollars.

At the end of the first year you have 3000 + (3000 * 0.055), which is 3165. At the end of the second year you have 3165 + (3165 * 0.055), which is 3339.08. Do this as many times as there are years. A for loop makes the calculation easy.

Code:#include<iostream.h> #include<conio.h> int main() { clrscr(); int i,y; char ch; float r,ans,n; cout<<"enter the initial amount:"; cin>>i; cout<<"enter the no of years:"; cin>>y; cout<<"enter the rate of interest (percent per year):"; cin>>r; for(ans=1;ans<=i;ans++) { ans=i+(i*r/100); cout<<"at the end of the year the balace willbe:"<<ans; cout<<"do you want to continue(y/n)"; cin>>ch; } cout<<endl; getch(); return 0; }