In this tutorial, we are going to learn the writing program in c to calculate the Simple Interest. Simple Interest is a mathematical term and we have a mathematical formula for this calculation.
Before starting writing the program let’s understand simple interests.
What is Simple Interest?
Simple interest is a method to calculate the interest charged on a loan. It is calculated by multiplying the interest rate by the principal by the number of days that elapse between payments.
Simple Interest Formula:
SI = (P*T*R)/100
Where,
P is principle amount
T is the time duration
R is the rate of interest
Example of how we can calculate simple interest
Input
Enter principle: 1200
Enter time: 2
Enter rate: 5.4
Output
Simple Interest = 129.600006
Logic we are following to calculate simple interest
- We are taking Principle amount, time and rate of interest as an input.
- Now after taking input we are simply calculating simple interest using formula
SI = (principle * time * rate) / 100
. - After calculating SI using above formula we are printing the value which is our program output.
Program in C to calculate Simple Interest
#include <stdio.h> int main() { float p, t, r, SI; printf("Program to calculate Simple Interest\n"); printf("Enter principle amount: "); scanf("%f", &p); printf("Enter time (in years): "); scanf("%f", &t); printf("Enter rate: "); scanf("%f", &r); SI = (p * t * r) / 100; printf("Simple Interest = %.2f", SI); return 0; }
Output

Share on
Also Prepare Below Important Question
- Java Program to Perform Left Rotation on Array Elements by Two
- Java Program to Perform Right Rotation on Array Elements by Two
- Java Program to Print Odd Numbers from Array
- Java Program to Print All Even Numbers in Array
- Java Program to Find the Sum of Array Elements
- Java Program to Delete Element of Array At Given Location
- Java Program to Delete a given Element of Array
- Java Program to Delete Element at End of Array
- Java Program to Insert Element in Array at given Location
- Java Program to Insert Element At the End of Array
- Java Program to Print Length of an Array
- Reverse Array without using Second Array or inplace Reversal Java Program
- Java Program to Print Array in Reverse Order
- Java Program to Sort String Character in Descending order
- Java Program to Sort String in Ascending Order
- Java Program to Print non Repeating Characters in String
- Java Program to Find Sum of Integers in the String
- Java Program to Remove Duplicates From String
- Java Program to Concatenate two Strings
- Java Program to Check if two Strings are Same
Interview Questions Categories
C Programming Interview Preparation
Core Java Programming Interview Preparation
- Core Java Programming Coding Questions
- Core Java Pattern Programming Questions
- Core Java Programming Interview Questions