Computer Science, asked by princey, 1 year ago

Write a C++ program to input principal amount : and time. If time is more than 10 years, calculate the simple interest with rate 8%. Otherwise calculate it with rate 12% per annum.

Answers

Answered by amanverma3
47
#include<iostream.h>
#include<conio.h>
main()
{float p,t,si;
cout<<"Enter principal amount ";
cin>>p;
cout<<endl<<"Enter time (yrs) ";
cin>>t;
if(t>10)
{ si=p*8*t;
cout<<endl<<"Simple interest= "<<si;
}
else
{ si=p*12*t;
cout<<endl<<"Simple interest= "<<si;
}
getch();
return 0;
}
Similar questions