Q:

EMI Calculator (C program to calculate EMI)

0

EMI Calculator (C program to calculate EMI)

EMI Calculator: This program will read total loan amount (principal), rate and time in years and prints the per month EMI of that loan amount.

The formula used in this program is:
(P*R*(1+R)T)/(((1+R)T)-1)

Here,

  • P is loan amount.
  • R is interest rate per month - we will read in yearly and convert in monthly in program.
  • T is loan time period in year - we will read in yearly and convert in monthly in program.
  •  

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

EMI Calculator program in C

/*EMI Calculator (C program to calculate EMI).*/

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

int main()
{
    float principal, rate, time, emi;

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

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

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

    rate = rate / (12 * 100); /*one month interest*/
    time = time * 12; /*one month period*/

    emi = (principal * rate * pow(1 + rate, time)) / (pow(1 + rate, time) - 1);

    printf("Monthly EMI is= %f\n", emi);

    return 0;
}

Output:

    Enter principal: 20000
    Enter rate: 10
    Enter time in year: 2
    Monthly EMI is= 922.899536

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C language important programs ( Advance Programs )

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C program to create your own header file/ Create y... >>
<< C program to validate date (Check date is valid or...