1 Tìm số tiền nhận trong n tháng khi biết lãi xuất Thu Aug 18, 2011 9:30 pm
El Kun
Super Moderator
Tìm số tiền nhận trong n tháng khi biết lãi xuất
- Code:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
double sotiengui,tienlai,laixuat;
int sothang;
cout<<"Nhap vao so tien gui: ";cin>>sotiengui;
cout<<"Nhap vao lai xuat(%): ";cin>>laixuat;
cout<<"Nhap vao so thang gui: ";cin>>sothang;
for(int i=1;i<=sothang;i++)
{
tienlai=laixuat*sotiengui;
sotiengui=sotiengui+tienlai;
}
cout<<"Vay so tien nguoi do gui trong "<<sothang<<" thang la: "<<sotiengui;
getch();
}