C Program to find compound interest.

Logic to calculate compound interest

Step by step descriptive logic to find compound interest.

  1. Input principal amount. Store it in some variable say principle.
  2. Input time in some variable says time.
  3. Input rate in some variable says rate.
  4. Calculate compound interest using the formula, CI = principle * pow((1 + rate / 100), time).
  5. Finally, print the resultant value of ci.

#include <stdio.h>
#include <math.h>
void main()
{
    float principle,rate,time,ci;
    printf("Enter the value of principle,rate,time");
    scanf("%f%f%f",&principle,&rate,&time);
    ci=principle*(pow((1+rate/100),time));
    printf("ci is =%f",ci);
}

 Expected Output:-



Post a Comment

Previous Post Next Post