A C program to calculate simple interest using inline function. SimpleInterestInlineFunction.cpp. Ashish Shukla October 7, 2018. Write C program to calculate the simple compound interest with necessary exception handling functions.(Consider 3 input parameters Amt, Time, Interest Rate, And output should be the total Amount after compounding.
devquoraWe can easily understand the whole program by this algorithm. Algorithm to find simple interest: 1. Start the program. Read Principal amount, rate of interest and time period. Calculate interest by using the formula. Print the simple interest. Stop the program. The flowchart for simple interest is attached below.
Overview:
Let us learn how to calculate simple interest in C programming language. Simple interest is basically a quick and easy calculation of the interest charged on a given principal amount. Before going to write the c program to Calculate Simple Interest, let's understand What is Interest?, What are the types of Interest?, and What is Simple Interest? Moreover, I will show How to calculate Simple Interest? and define P, R and T in a simple interest formula. Furthermore, I will demonstrate the logic to calculate Simple Interest. After all, I will write a logic and C program to Calculate Simple Interest with output.
Table of contents:
- What is Interest?
- What are the types of Interest?
- What is Simple Interest?
- How to calculate Simple Interest?
- What is Principal amount?
- What is rate of Interest?
- What do you mean by time in Simple Interest formula?
- Demonstration to calculate simple interest
- Logic to calculate simple interest
- C Program to Calculate Simple Interest with output
- Conclusion
What is Interest?
Interest is the extra money that the borrower pays for using the lender’s money. When a person lends money to a borrower, the borrower usually has to pay an extra amount of money to the lender. This extra money is what we call the interest. In other words, If you deposit money in a bank, interest is the money that you earn, as a percentage of your deposit.
What are the types of Interest?
There are three types of Interest as follows:
What is Simple Interest?
Simple Interest (S.I) is the method of calculating the interest amount for some principal amount of money. In other words, Simple Interest is the rate at which we lend or borrow money.
How to calculate Simple Interest?
Simple interest formula calculated by following Simple Interest formula:
Simple Interest = (Principal Amount × Rate of Interest × Number of years) / 100
or
SI = (P × R × T)/100
Where,
SI is the Simple Interest
P is the principle amount
T is the time period for which money is invested
R is the rate of interest
What is Principal amount?
It is a starting amount of money. In the context of borrowing, principal is the initial size of a loan; it can also be the amount still owed on a loan.
What is rate of Interest?
The interest rate is the amount a lender charges for the use of assets expressed as a percentage of the principal. It is the interest rate per year.
What do you mean by T in Simple Interest formula?
![Write a program in c++ to calculate simple interest using inline function Write a program in c++ to calculate simple interest using inline function](https://sites.google.com/site/languageguru1234/_/rsrc/1528814648458/c-programs/2-find-simple-interest/Screenshot 2018-06-12 20.11.58.png)
T is the time period for which money is invested or borrowed.
Demonstration to calculate simple interest
To calculate simple interest we will take help of this formula:
You can understand it from the following example:
Question:Calculate the Simple Interest if the principal amount is Rs. 2000, the time period is 1 year and the rate is 10%.
Solution:According to the formula of simple interest we have,
S.I. = [(Principal (P) × Time (T) × Rate (r)) / 100]
So, from the above values,
S.I. = [(2000 × 1 × 10)] / 100 = 20000/100 =200
So, the simple interest at the end of 1 year will be Rs. 200.
Logic to calculate simple interest
- Step 1:Input principal amount in some variable say principle.
- Step 2:Input time in some variable say time.
- Step 3:Input rate in some variable say rate.
- Step 4:Find simple interest using formula SI = (principle * time * rate) / 100.
- Step 5:Finally, print the resultant value of SI.
C Program to Calculate Simple Interest
When the above code is executed, it produces the following results:
Enter the principal amount: 12
Enter time: 2
Enter rate: 3
Simple Interest = 0.720000
This C program allows the user to enter the Principal Amount, Rate of Interest, and the Number of years. By using those values, this C Program will calculate the Simple Interest using following formula: Simple Interest = (Principal Amount * Rate of Interest * Number of years) / 100.
Related Questions
Please Loginor Registerto leave a response.
Write A C++ Program To Calculate Simple Interest Using Class
Never Miss an Articles from us.Cross Platform Frameworks for Mobile App Development How to Crack HTML5 Interview Questions RavenDB: Fully Transactional NoSQL Database Tips to Crack the Coding Interviews Cloud Computing: A Big Relief For Accountants
- Common Interview Questions
- Python Flask Interview Questions
- NoSQL interview questions
- JQuery Interview Questions
- C programming interview questions
- AngularJS Interview Questions
- Node JS Interview Questions with Express
- JavaScript Interview Questions
- Core Java interview questions
- HTML Interview Questions
- Laravel interview questions
- Wordpress Interview Questions
- PHP Interview Questions