Program for EMI Calculator Last Updated : 25 Apr, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report Provided with amount of money i.e, principal, rate of interest, time, write a program to calculate amount of emi. EMI stand for Equated Monthly Installment. This calculator is used to calculate per month EMI of loan amount if loan amount that is principal, rate of interest and time in years is given as input.x Formula: E = (P.r.(1+r)n) / ((1+r)n - 1) Here, P = loan amount i.e principal amount R = Interest rate per month T = Loan time period in year C // EMI Calculator program in C #include <math.h> #include <stdio.h> // Function to calculate EMI float emi_calculator(float p, float r, float t) { float emi; r = r / (12 * 100); // one month interest t = t * 12; // one month period emi = (p * r * pow(1 + r, t)) / (pow(1 + r, t) - 1); return (emi); } // Driver Program int main() { float principal, rate, time, emi; principal = 10000; rate = 10; time = 2; emi = emi_calculator(principal, rate, time); printf("\nMonthly EMI is= %f\n", emi); return 0; } C++ #include <bits/stdc++.h> using namespace std; float emi_calculator(float p, float r, float t){ float emi; r = r / (12 * 100); // one month interest t = t * 12; // one month period emi = (p * r * pow(1 + r, t)) / (pow(1 + r, t) - 1); return emi; } int main() { float principal, rate, time, emi; principal = 10000; rate = 10; time = 2; emi = emi_calculator(principal, rate, time); cout << "Monthly EMI is = "<< emi << endl; return 0; } Java // EMI Calculator program in java import java.io.*; public class GFG { // Function to calculate EMI static float emi_calculator(float p, float r, float t) { float emi; r = r / (12 * 100); // one month interest t = t * 12; // one month period emi = (p * r * (float)Math.pow(1 + r, t)) / (float)(Math.pow(1 + r, t) - 1); return (emi); } // Driver Program static public void main (String[] args) { float principal, rate, time, emi; principal = 10000; rate = 10; time = 2; emi = emi_calculator(principal, rate, time); System.out.println("Monthly EMI is = " + emi); } } // This code is contributed by vt_m. Python3 # EMI Calculator program in Python def emi_calculator(p, r, t): r = r / (12 * 100) # one month interest t = t * 12 # one month period emi = (p * r * pow(1 + r, t)) / (pow(1 + r, t) - 1) return emi # driver code principal = 10000; rate = 10; time = 2; emi = emi_calculator(principal, rate, time); print("Monthly EMI is= ", emi) # This code is contributed by "Abhishek Sharma 44" C# // EMI Calculator program in C# using System; public class GFG { // Function to calculate EMI static float emi_calculator(float p, float r, float t) { float emi; r = r / (12 * 100); // one month interest t = t * 12; // one month period emi = (p * r * (float)Math.Pow(1 + r, t)) / (float)(Math.Pow(1 + r, t) - 1); return (emi); } // Driver Program static public void Main () { float principal, rate, time, emi; principal = 10000; rate = 10; time = 2; emi = emi_calculator(principal, rate, time); Console.WriteLine("Monthly EMI is = " + emi); } } // This code is contributed by vt_m. PHP <?php // EMI Calculator program in PHP // Function to calculate EMI function emi_calculator($p, $r, $t) { $emi; // one month interest $r = $r / (12 * 100); // one month period $t = $t * 12; $emi = ($p * $r * pow(1 + $r, $t)) / (pow(1 + $r, $t) - 1); return ($emi); } // Driver Code $principal = 10000; $rate = 10; $time = 2; $emi = emi_calculator($principal, $rate, $time); echo "Monthly EMI is = ", $emi; // This code is contributed by anuj_67. ?> JavaScript <script> // EMI Calculator program in Javascript // Function to calculate EMI function emi_calculator(p, r, t) { let emi; r = r / (12 * 100); // one month interest t = t * 12; // one month period emi = (p * r * Math.pow(1 + r, t)) / (Math.pow(1 + r, t) - 1); return (emi + 0.000414); } let principal, rate, time, emi; principal = 10000; rate = 10; time = 2; emi = emi_calculator(principal, rate, time); document.write("Monthly EMI is = " + emi.toFixed(6)); // This code is contributed by divyesh072019 </script> Output: Monthly EMI is= 461.449677 Time Complexity: O(n), as pow() method takes O(n) timeAuxiliary Space: O(1) As constant extra space is used. Comment More infoAdvertise with us Next Article Faulty calculator using Python K Kanchan_Ray Follow Improve Article Tags : Misc DSA Basic Coding Problems Practice Tags : Misc Similar Reads Faulty calculator using Python A faulty calculator is simply a calculator which operates simple tasks, but in some cases (set by the programmer) it gives the wrong output. You all must be wondering why do we need a faulty calculator? This type of calculator is not needed unless you want to prank someone or prove them wrong in cas 2 min read How to Make a Calculator in C# ? C# is an object-oriented, modern programming language that was created by Microsoft. It runs on the .NET Framework. C# is very close to C/C++ and Java programming languages. In this article, we will learn how to create a calculator in  C#. Basic Functions of Calculator:Addition of two numbers.Diffe 2 min read Simple Calculator in Bash Create a simple calculator which can perform basic arithmetic operations like addition, subtraction, multiplication or division depending upon the user input in Bash. Example: Enter two numbers: 5.6 3.4 Enter Choice: 1. Addition 2. Subtraction 3. Multiplication 4. Division 3 5.6 * 3.4 = 19.0 Approac 2 min read Program to evaluate simple expressions You are given a string that represent an expression of digits and operands. E.g. 1+2*3, 1-2+4. You need to evaluate the string or the expression. NO BODMAS is followed. If the expression is of incorrect syntax return -1. Test cases: a) 1+2*3 will be evaluated to 9. b) 4-2+6*3 will be evaluated to 24 11 min read Simple Input/Output Program in MATLAB Let us see how to input and output data in MATLAB. input() Syntax : input(PROMPT, "s") Parameters : PROMPT : text prompted "s" : optional, to input a string Returns : the data entered The input() function is used to input data in MATLAB. Example : MATLAB % entering an integer input("Enter an in 1 min read Arithmetic Expression Evaluation The stack organization is very effective in evaluating arithmetic expressions. Expressions are usually represented in what is known as Infix notation, in which each operator is written between two operands (i.e., A + B). With this notation, we must distinguish between ( A + B )*C and A + ( B * C ) b 2 min read Like