Compound interest || Basic program || C programming

In this, we are going to write a program to find compound interest in C.


#include <stdio.h>
#include <math.h>
int main()
{
    float principle, rate, time, CI;

    // Input principle, time and rate
    printf("Enter principle (amount): ");
    scanf("%f", &principle);

    printf("Enter time: ");
    scanf("%f", &time);

    printf("Enter rate: ");
    scanf("%f", &rate);

    // Calculate compound interest
    CI = principle* (pow((1 + rate / 100), time));
    // Print the resultant CI
    printf("Compound Interest = %f", CI);

    return 0;
}
//.....Coded by JAIDEEP JAMBLE

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post