C Programs | IT Developer
IT Developer

C Programs



Share with a Friend

Simple Interest Calculation Program in C

Introduction

Simple Interest (SI) is a basic concept in finance that helps calculate the interest on a principal amount over a period of time at a given rate of interest.

The formula is:

SI=(P×R×T)/100

where

  • P = Principal (initial amount)
  • R = Rate of Interest (per annum, in %)
  • T = Time (in years)

This program asks the user to input P, R, T and then calculates the Simple Interest.

C Program: Simple Interest Calculation

C

#include <stdio.h>

 

int main() {

    float principal, rate, time, simple_interest;

 

    // Input principal, rate, and time

    printf("Enter Principal amount: ");

    scanf("%f", &principal);

 

    printf("Enter Rate of Interest (in %%): ");

    scanf("%f", &rate);

 

    printf("Enter Time (in years): ");

    scanf("%f", &time);

 

    // Calculate Simple Interest

    simple_interest = (principal * rate * time) / 100;

 

    // Display result

    printf("Simple Interest = %.2f\n", simple_interest);

 

    return 0;

}

Output

 
OUTPUT 1 :
Enter Principal amount: 1000
Enter Rate of Interest (in %): 5
Enter Time (in years): 2
Simple Interest = 100.00

OUTPUT 2 :
Enter Principal amount: 2500
Enter Rate of Interest (in %): 7.5
Enter Time (in years): 3
Simple Interest = 562.50


Explanation

  1. The program asks the user for principal, rate, and time.
  2. Formula applied: (P × R × T) ÷ 100.
  3. The result is printed with two decimal places.