C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs

Home » C solved programs » Advance C programs

C program to calculate compound interest

This program will read principal, rate and time in years and then print compound interest on entered principal for given time period.

Compound interest is the amount in which interest is added into the principle so that interest also can be earned interest with the principle.

The formula to get compound interest is:

Calculate Compound Interest using C program

/*C program to calculate compound interest.*/

#include <stdio.h>
#include <math.h>

int main()
    float principal, rate, year, ci;
    printf("Enter principal: ");
    scanf("%f", &principal);
    printf("Enter rate: ");
    scanf("%f", &rate);    
    printf("Enter time in years: ");
    scanf("%f", &year);

    //calculate compound interest

    printf("Compound interest is: %f\n",ci);
    return 0;


    Enter principal: 10000
    Enter rate: 10.25 
    Enter time in years: 5
    Compound interest is: 6288.943359 

You may also be interested in...

C/C++ Tips and Tricks...

Was this page helpful? YES NO

Are you a blogger? Join our Blogging forum.

Comments and Discussions