
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Program for EMI Calculator in C program
Given with certain values the program will develop an EMI calculator to generate the needed output. EMI stands for Equated Monthly Installment. So this calculator will generate monthly EMI amount for the user.
Example
Input-: principal = 2000 rate = 5 time = 4 Output-: Monthly EMI is= 46.058037
The formula used in the below program is −
EMI : (P*R*(1+R)T)/(((1+R)T)-1)
where,
P indicates loan amount or the Principal amount.
R indicates interest rate per month
T indicates loan time period in year
Approach used below is as follows
- Input principal, rate of interest and time in float variable
- Apply the formula to calculate the EMI amount
- Print the EMI amount
Algorithm
Start Step 1 -> Declare function to calculate EMI float calculate_EMI(float p, float r, float t) float emi set r = r / (12 * 100) Set t = t * 12 Set emi = (p * r * pow(1 + r, t)) / (pow(1 + r, t) - 1) Return emi Step 2 -> In main() Declare variable as float principal, rate, time, emi Set principal = 2000, rate = 5, time = 4 Set emi = calculate_EMI(principal, rate, time) Print emi Stop
Example
#include <math.h> #include <stdio.h> // Function to calculate EMI float calculate_EMI(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 = 2000; rate = 5; time = 4; emi = calculate_EMI(principal, rate, time); printf("
Monthly EMI is= %f
", emi); return 0; }
Output
Monthly EMI is= 46.058037
- Related Articles
- Menu Driven C++ Program for a Simple Calculator
- Basic calculator program using C#
- C/C++ program to make a simple calculator?
- Basic calculator program using Python program
- How to design a Loan EMI Calculator using HTML, CSS and JavaScript?
- Basic calculator program using Java
- Basic calculator program using Python
- Program to create grade calculator in Python
- Java Program to create a Calculator
- How to write a simple calculator program using C language?
- C Program for Program for array rotation?
- Python Program to Create a class performing Calculator Operations
- Basic Calculator in C++
- Program for factorial of a number in C program
- Java program to generate a calculator using the switch case

Advertisements