can someone help me with this...the program should exit it shounld go back to the start...help .it is forloop...help me fast...email me the ans..plzzzz.. :)
#include <iostream.h>
#include <stdlib.h>
int main()
{
double princple_amount,rate;
int years,x;
cout<<"Enter initial amount : \t" ;
cin>>princple_amount;
cout <<endl;
cout<< "number of years: \t";
cin>>years;
cout <<endl;
cout<<"Enter interest rate (percent per year):\t" ;
cin>>rate;
cout <<endl;
for ( x=1;x<=years; x=x+1)
{
princple_amount= princple_amount+(princple_amount*rate/100);
}
cout<< " At the end of "<<years<< " years, you will have \t$";
cout<<princple_amount<<endl;
system("PAUSE");
return 0;
}
Comments
Leave a comment