C++ Program to find simple interest if some conditions are given.

C++ program to input principal amount and time (in years) .If time is more than 10 years ,
calculate simple interest with rate 8% otherwise calculate it with 12% per annum.



Here I used        formula   ....      Simple Interest =(P*R*T)/100

lets start....


//start
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{ clrscr();
float p,t,si;
cout<<"Enter Principal and Time(year) :";
cin>>p>>t;
if (t>=10.0)
{
si=8.0*(p*t)/100.0;
cout<<"Simple Interest is :"<<si;
}
else
{
si=12.0*(p*t)/100.0;
cout<<"Simple interest is :"<<si;
}
getch();
}
//end


Press          Alt+F9   to compile program.
Then Press Ctrl+F9  to run program.

If you need help ,comment below.

please share this blog to your friends

Subscribe us for Future posts (My C Plus Plus)
Thank you

About Author:

Hey Cyber Astronauts, Welcome to the one of best blog The CyberSpace HUB. I'm Himanshu Singh, a Part-time-blogger from India. Here at The CyberSpace HUB I write about Starting and managing a blog,Latest technology and Making Money online.


Join Me: Twitter | Facebook | Google Plus


EmoticonEmoticon