# Calculate Compound Interest C Program

By | July 25, 2016

## C Program To Calculate Compound Interest

Let us learn how to write a program to calculate Compound Interest in C programming language. This C program to find compound interest takes in values of Principal Amount, ROI and Time Period from the user.

#### What is Compound Interest?

Compound Interest is the interest computed on the initial principal amount and also on the accumulated interest of previous periods of a deposit or a loan.

#### Formula To Find Compound Interest

a = p (1 + r/n) nt

where,

a = value of the returns

p = Principal Amount

r = Rate of Interest

n = Number of times that Interest is compounded each year

t = Number of Years (Period)

#### Output

p = ₹ 5000

r = 10%

n = 12

t = 5

Compound Interest = ₹ 8226.54

Must Read: C Program To Find Simple Interest using Functions

#### Method 2: Calculate Compound Interest in C Programming using Function

Must Read: C Program To Find LCM of Two Numbers

#### Output

If you have any doubts or compilation errors in this C program to compute compound interest, let us know about it in the comment section below.

## 6 thoughts on “Calculate Compound Interest C Program”

1. Vikash Jain

Thanks for this awesome code. But, when I try this Compound Interest C Program in Windows, it works fine. But, in Linux it gives an errof regarding the pow() method. Please help.

1. Tushar Soni Post author

Execute it using this command:
gcc testprogram.c -lm

2. Vicky Dhende

Amazingly simple program for compound interest. Thanks

3. Rajesh Arora

Compound Interest is too powerful as compared to the Simple Interest. The compound interest ads the annual interest to the principal amount and the next year interest is calculated on the principal and previous interest received. Therefore, the benefits out of compound interest are much more.

4. Akim Shaikh

Really good explanation of compound interest in C programming.

5. Prerit Agarwal

Sir why we have used -lm command line and ./a.out