Tuesday, March 6, 2018

EMI Calculator

This C program will help you to calculate your EMI. EMI means  Equated Monthly Installment. You can also use this C program to calculate monthly loan installment or personal loan estimator. 

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

int main()
{
    float principal_amount, roi, time, emi;

    printf("Enter your principal amount (INR): ");
    scanf("%f", &principal_amount);

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

    printf("Enter your loan time in years: ");
    scanf("%f",&time);

    roi = roi/(12*100); /*interest for one month*/
    time=time*12; /*time for one month*/

    emi= (principal_amount*roi*pow(1+roi,time))/(pow(1+roi,time)-1);

    printf("Monthly EMI (INR) = %0.2f\n",emi);
   
    return 0;
}

Output of program

Enter your principal amount (INR): 50000
Enter rate of interest: 12
Enter your loan time in years: 5
Monthly EMI (INR) = 1112.22

1 comment:

  1. Thx u very very very much bcause it really helped to find my mistake. btw i m a 9th grade self learning programmer.

    ReplyDelete