cpp program2
write a program accept principle rate and time form user and print
the simple interest
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
float principle,rate,year,simple;
cout<<"enter principle value=";
cin>>principle;
cout<<"enter rate value=";
cin>>rate;
cout<<"enter year value=";
cin>>year;
simple=principle*rate*year/100;
//cout<<"enter principle value="<<principle;
//cout<<"enter rate value="<<rate;
//cout<<"enter year value="<<year;
cout<<"simple interest="<<simple;
getch();
return 0;
}
</div>
OUTPUT
#include<conio.h>
int main()
{
clrscr();
float principle,rate,year,simple;
cout<<"enter principle value=";
cin>>principle;
cout<<"enter rate value=";
cin>>rate;
cout<<"enter year value=";
cin>>year;
simple=principle*rate*year/100;
//cout<<"enter principle value="<<principle;
//cout<<"enter rate value="<<rate;
//cout<<"enter year value="<<year;
cout<<"simple interest="<<simple;
getch();
return 0;
}
</div>
enter principle value=1000
enter rate value=10
enter year value=1
Comments
Post a Comment
Thanks for your comment