# C program, algorithm, flowchart & explanation of the program that calculates the Simple Interest and Compound Interest. The Principal, Amount, Rate of interest and Time are entered through the keyboard.

## Write a C program to calculates the Simple Interest and Compound Interest. The Principal amount, Rate of interest and Time are entered through the keyboard:-

Here, we have to write a simple C program that calculates the Simple Interest and Compound Interest. The user will enter the Principal amount, Rate of interest, and Time.

### Formulae used:-

Simple interest=(p*r*t)/100

where, p= Principal amount

r= Rate of interest

t= Time of investment.

Compound interest= p*(1+r/100)^t        (assumption taken only one-time interest got compounded annually)

## Explanation & Program code:-

We will ask the user to enter the value of the principal amount, rate of interest, and time of investment then we will store the entered value into the variables named p,r, and t respectively. Based on the entered radius value, we will calculate the simple interest and compound interest. To make the program code easier we have taken the assumption that only one-time interest gets compounded annually(in the question mentioned take the value of p, r, t from the user). Further details are mentioned as comments in the program code.

## Algorithm of the program to calculate Simple interest and compound interest:-

Step 1:- Start.
Step 2:- Declaration of variables.
Step 3:- Read principle amount, rate of interest, time of investment.
Step 4:- Simple interest=(p*r*t)/100 and total amount with S.I=Simple interest + principal amount.
Step 5:- Print Simple Interest and Total amount with simple interest.
Step 6:- Compound interest= p*(1+r/100)^t and total amount with C.I=C.I+principal amount.
Step 7:- Print Compound interest and total amount with compound interest.
Step 8:- Stop.

## Flowchart of the program to calculate the Simple interest and Compound interest:-

As you have reached the end of the article, so I hope as of now you have a clear understanding of the program, algorithm, and flowchart to calculate the Simple interest and compound interest. Please let me know your queries, suggestion, and feedback in the comment section.