Author Topic: Turbo C Program to Calculate Simple Interest  (Read 3946 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Turbo C Program to Calculate Simple Interest
« on: December 29, 2011, 01:07:08 pm »
Here is the Turbo C Program to Calculate Simple Interest.

The formula is,

simple interest = PNR / 100

where P - principal amount
           N - number of years
           R - Interest Rate %

Code:
//Source Code Listing


#include <stdio.h>

void main()
{
   double amount;
   double years;
   double interest_rate;
   double simple_interest;
   
   printf("Enter Principal Amount :");
   scanf("%lf",&amount);

   printf("Enter Number of Years:");
   scanf("%lf",&years);

   printf("Enter Interest Rate:");
   scanf("%lf",&interest_rate);

   simple_interest = (amount * years * interest_rate) / 100; 
   printf("Simple Interest = %lf\n",simple_interest);

}

/***

Sample Output: 

Enter Principal Amount :1000
Enter Number of Years:5
Enter Interest Rate:4.99
Simple Interest = 249.500000

****/

« Last Edit: December 29, 2011, 01:30:07 pm by kathir »

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1