⓮C Program to calculate Simple Interest (With Program and Explanation)
๐Program to calculate Simple Interest
Simple Interest Formula :-
Where:
-
P = Principal amount
-
R = Rate of interest (per year)
-
T = Time (in years)
๐งพ C Program to Calculate Simple Interest
๐ง Explanation of the Program
1️⃣ Header File
-
This header file is used for input and output functions like
printf()andscanf().
2️⃣ Variable Declaration
-
principal→ stores the principal amount -
rate→ stores the rate of interest -
time→ stores time in years -
simpleInterest→ stores the calculated SI
float is used to handle decimal values.
3️⃣ Taking Input
-
These statements take values from the user.
4️⃣ Calculation
-
Applies the Simple Interest formula.
5️⃣ Output
-
Displays the result up to 2 decimal places.
๐ Sample Output
✅ Key Points (For Blog Highlight)
-
Uses basic arithmetic
-
Beginner-friendly C program
-
Real-life application
-
Uses
floatfor accuracy
๐ Conclusion
This program demonstrates how to calculate Simple Interest using simple arithmetic operations.
Comments
Post a Comment