C program to find compound interest is a simple mathematical equation solving implementation in the c program.

What is compound interest?
Compound interest is calculated on initial the principal amount and also interest on the investment of previous periods of the loan.
The value compound is reinvesting the interest, rather than paying it out.

Compound interest formula
Compound interest = Principal((1+rate/n)^(n*time))
Where the principal is the principal amount to be invested
Rate is a rate of interest
N is no of days amount investment
Times is number of time compounded

Example :-
Principal = 5000, Rate = 5, No of year = 10, Times = 12
Compound interest =Principal((1+rate/n)^(n*time))
Compound interest = 8235.04

Algorithm to calculate compound interest

  1. Declare variables
  2. Take inputs from user principal, rate, no, and times
  3. Calculate compound interest using formula.
    Compound interest =Principal((1+rate/n)^(n*time))
  4. Print Compound interest

C program to find compound interest






float compoundInterest,principal,rate,time;

int n;

printf("Enter Principal\n");


printf("Enter rate in percentage\n");


printf("Enter time in years(demcimals)\n");


printf("Enter number of times interest is compounded per year\n");


printf("Compound Interest is %f\n",compoundInterest);


Output :

C program to find compound interest

Write A Comment