Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void options();
- void testInterest();
- double simpleInterest(double pAmmount,double aInterest,int years);
- double compoundInterest(double pAmmount,double aInterest,int yeard);
- int main()
- {
- options();
- }
- void testInterest()
- {
- }
- void options()
- {
- int options;
- int year;
- int annualIn;
- int pammount;
- printf("Simple Interest Calulcator - 1 \n");
- printf("Compound Interest Calculator - 2 \n");
- printf ("Choose option \n");
- scanf ("%d",&options);
- printf ("Enter the Principle ammount ");
- scanf ("%d",&pammount);
- printf("Enter the annula Interest");
- scanf ("%d",&annualIn);
- printf("Enter the number of years");
- scanf ("%d",&year);
- if (options == 1)
- {
- int s1;
- s1=simpleInterest(pammount,annualIn,year);
- printf ("%d",s1);
- }
- else
- {
- int s1;
- s1=compoundInterest(pammount,annualIn,year);
- printf ("%d",s1);
- }
- }
- double simpleInterest(double pAmmount,double aInterest,int years)
- {
- int Bammount;
- Bammount=pAmmount*(1+aInterest*years);
- return Bammount;
- }
- double compoundInterest(double pAmmount,double aInterest,int yeard)
- {
- int Bammount;
- Bammount=pAmmount*((1+aInterest)*(1+aInterest));
- return Bammount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement