C Program to Calculate Simple Interest

devquora
devquora

Posted On: Dec 23, 2020

C Program to Calculate Simple Interest

 

Overview:

Let us learn how to calculate simple interest in C programming language. Simple interest is basically a quick and easy calculation of the interest charged on a given principal amount. Before going to write the c program to Calculate Simple Interest, let's understand What is Interest?, What are the types of Interest?, and What is Simple Interest? Moreover, I will show How to calculate Simple Interest? and define P, R and T in a simple interest formula. Furthermore, I will demonstrate the logic to calculate Simple Interest. After all, I will write a logic and C program to Calculate Simple Interest with output.

Table of contents:

  1. What is Interest?
  2. What are the types of Interest?
  3. What is Simple Interest?
  4. How to calculate Simple Interest?
  5. What is Principal amount?
  6. What is rate of Interest?
  7. What do you mean by time in Simple Interest formula?
  8. Demonstration to calculate simple interest
  9. Logic to calculate simple interest
  10. C Program to Calculate Simple Interest with output
  11. Conclusion

What is Interest?

Interest is the extra money that the borrower pays for using the lender’s money. When a person lends money to a borrower, the borrower usually has to pay an extra amount of money to the lender. This extra money is what we call the interest. In other words, If you deposit money in a bank, interest is the money that you earn, as a percentage of your deposit.

What are the types of Interest?

There are three types of Interest as follows:

  1. Simple (Regular) Interest
  2. Accrued Interest
  3. Compound Interest

What is Simple Interest?

Simple Interest (S.I) is the method of calculating the interest amount for some principal amount of money. In other words, Simple Interest is the rate at which we lend or borrow money.

How to calculate Simple Interest?

Simple interest formula calculated by following Simple Interest formula:

Simple Interest = (Principal Amount × Rate of Interest × Number of years) / 100

or

SI = (P × R × T)/100

Where,

SI is the Simple Interest

P is the principle amount

T is the time period for which money is invested

R is the rate of interest

What is Principal amount?

It is a starting amount of money. In the context of borrowing, principal is the initial size of a loan; it can also be the amount still owed on a loan.

What is rate of Interest?

The interest rate is the amount a lender charges for the use of assets expressed as a percentage of the principal. It is the interest rate per year.

What do you mean by T in Simple Interest formula?

T is the time period for which money is invested or borrowed.

Demonstration to calculate simple interest

To calculate simple interest we will take help of this formula:

Simple Interest Demo

You can understand it from the following example:

Question:Calculate the Simple Interest if the principal amount is Rs. 2000, the time period is 1 year and the rate is 10%.

Solution:According to the formula of simple interest we have,

S.I. = [(Principal (P) × Time (T) × Rate (r)) / 100]

So, from the above values,

S.I. = [(2000 × 1 × 10)] / 100 = 20000/100 =200

So, the simple interest at the end of 1 year will be Rs. 200.

Logic to calculate simple interest

  • Step 1:Input principal amount in some variable say principle.
  • Step 2:Input time in some variable say time.
  • Step 3:Input rate in some variable say rate.
  • Step 4:Find simple interest using formula SI = (principle * time * rate) / 100.
  • Step 5:Finally, print the resultant value of SI.

C Program to Calculate Simple Interest

/**
 * C program to calculate simple interest
 */

#include 

int main()
{
    float principal, time, rate, SI;

    /* Input principle, rate and time */
    printf("Enter principal (amount): ");
    scanf("%f", &principle);

    printf("Enter time: ");
    scanf("%f", &time);

    printf("Enter rate: ");
    scanf("%f", &rate);

    /* Calculate simple interest */
    SI = (principal * time * rate) / 100;

    /* Print the resultant value of SI */
    printf("Simple Interest = %f", SI);

    return 0;
}

The output of the Program with code:

When the above code is executed, it produces the following results:

Enter the principal amount: 12

Enter time: 2

Enter rate: 3

Simple Interest = 0.720000

Simple Interest Output

Conclusion:

This C program allows the user to enter the Principal Amount, Rate of Interest, and the Number of years. By using those values, this C Program will calculate the Simple Interest using following formula: Simple Interest = (Principal Amount * Rate of Interest * Number of years) / 100.

    Please Login or Register to leave a response.

    Related Articles

    C Program Examples

    C Program to convert Decimal to Binary Number

    A Decimal Number is constructed with any digit from 0 to 9. For instance, 24 is a Decimal Number constructed from the digits 2 and 4. A Binary Number is constructed with digits 0 and 1. For instance, ..

    C Program Examples

    C program to reverse a string

    This program reversed the entered string that means opposite of the previous string sequence...

    C Program Examples

    C program to reverse an Integer number

    Are you want a demonstration of The C Program that reverses an Integer number? This Program reversing the sequence of digits in an Integer. After the successful compilation of the program, a message..