×

Compound Interest Program in C

Interest on loans and deposits is compound interest. This is the most commonly used concept in everyday life. Compound interest on an amount is based on principal and interest earned over time. This is the main difference between simple interest and compound interest.

When you check your bank statement, you usually see interest credited to your account annually. This annual interest rate fluctuates around the same principal amount. You can see that the interest is increasing year by year. From this, we can conclude that bank interest is not net interest. See this article for the definition of compound interest and the formulas and derivations for calculating compound interest, such as annual, semi-annual, and quarterly.

Additionally, the examples presented here, based on real-world applications of compound interest, will help you understand why compound interest returns are higher than simple interest returns. The term "compound interest" refers to the original principal and the interest accrued over time, as previously stated. The formula for compound interest is as follows:

 Amount minus principal = compound interest

The addition of interest to the principal of a loan or deposit is known as compound interest or compound interest Instead of paying interest. It is reinvested so that you will earn interest on the principal in the next period in addition to the interest already accumulated. Compound interest is common in economics and finance.

Compound interest has a compound interest, unlike simple interest, which does not add interest to the principal and does not compound interest.

 Compound Interest Formula

 The formula for compounding annual interest is:

Compound Interest = Amount - P (P is principal, R is the interest rate, T is period)

Pseudocode

Enter the principal sum. Store it in some factor, say head.

Time can be entered into a variable.

Some variable, such as rate, has an input rate.

Use the formula Amount = principal * (1 + rate / 100) time to determine the amount.

Utilize a formula to calculate compound interest.

At long last, print the resultant worth of CI.

How is Compound Interest Calculated?

 The formula X=P[(1+i)*n-1] is used to find out how much interest a balance will earn in a compound interest environment where n is the number of compound interest, i is the nominal interest rate in decimals, and P is the principal The amount of interest added to the principal is X Consider the previous diagram again.

For example, a $100 loan for 3 years at 5% annual interest. This is what the formula looks like. Solving for X=100[(1+0.05)3-1], we find that the interest payments on the loan after three years total $115.76, or $15.76 per month. Note that using simple interest, the balance of this loan would be only $115.

Compound interest doesn't just apply to loans. It can also be applied to investments A metric called compound annual growth rate (CAGR) is used to determine the long-term return on investment in a compounding environment CAGR can be used to estimate the expected growth of an investment portfolio over time. This is useful when planning goals such as saving for retirement from college.

Additionally, it can be used to assess portfolio and fund manager performance relative to market returns For example, if a fund manager's total five-year return is 4% of his return, while the market's index return is 5% of his, the fund manager underperforms the market. increase. Similarly, if a manager returns 6%, it will outperform the market.

#include<stdio.h>
#include <math.h>
int main() 
{
   float PAmount, ROI, Time_Period, CIFuture, CI;
printf("\nPlease enter the Principal Amount : \n");
scanf("%f", &PAmount);
printf("Please Enter Rate Of Interest : \n");
scanf("%f", &ROI);
printf("Please Enter the Time Period in Years : \n");
scanf("%f", &Time_Period);
   CIFuture = PAmount * (pow(( 1 + ROI/100), Time_Period));
   CI = CIFuture - PAmount;
printf("\nFuture Compound Interest for Principal Amount %.2f is = %.2f", PAmount, CIFuture);
printf("\nCompound Interest for Principal Amount %.2f is = %.2f", PAmount, CI);
   return 0;
}

Output:

Please enter the principal amount
 200000
Please enter the rate of interest
2.5
Please enter the time period in years
7
 The future Compound Interest for Principal Amount 200000.0 is 237737.11
Compound Interest for the Principal Amount of 200000.0 is 37737.11

Related Topics

Pyramid Pattern in C

Pyramid Pattern in C A pyramid is a polyhedron created by connecting a base that will be a polygon, and all the lateral faces are triangles. All the bases are connected...

5 minutes read.

Deadlock Detection Program in C

What is Deadlock? A deadlock is a circumstance where a group in the process is halted because they are each holding onto resources while waiting for other methods to obtain them. Think...

5 minutes read.

How to convert a number to words in C

There are many ways available for converting an integer or a number to its word form. For example, consider a number as 12345. This number can be represented in two...

3 minutes read.

How to use Typedef Struct in C

The “typedef” is a predefined keyword in C programming language which is used to declare the new name to an existing type of variable. For better understanding, if you declare a...

3 minutes read.

Function in C

Function is a group of statements that are used to perform any task. In other words, we can say that a function is a self- contained a block of programs...

3 minutes read.

Pure Virtual Function in C

Before knowing about the pure virtual function some of the important points about the virtual function in C++ are given below. In c++ the member function that is defined in the...

4 minutes read.

Typedef vs define in C

Typedef VS define in C Typedef In the C programming language, a keyword called typedef can be used to give a type a new name. In other words, it is used to...

5 minutes read.

GCD program of two numbers in C

GCD stands for Greatest Common Divisor, which is also known as Highest Common Factor, which can be abbreviated as HCF. Mathematically it can be defined as any two positive integers...

3 minutes read.

Positioning of file in C

Positioning() function in c The fseek() function is utilized to change the document position of the stream . The fully extent of value from the source should be one of the...

3 minutes read.

C Program Swap Numbers in cyclic order Using Call by Reference

The three integers that the user entered in cyclical sequence are swapped in this tutorial using call by reference. C Program: #include <stdio.h> void cyclic_Swap ( int *X, int *Y, int *Z ); int...

2 minutes read.

Distance Vector Routing Protocol Program in c

A distance-vector routing protocol is one of the foremost instructions of routing protocols in pc conversation principle for packet-switched networks. The hyperlink-nation protocol is the alternative foremost class.The Bellman-Ford set...

4 minutes read.

Find Day from Day in C Without using function

Introduction: In the given article, I find daily in C without using functions. It takes 365 days for the earth to revolve around the sun. It will be close to...

3 minutes read.

Modulus on Negative Numbers in C

In this tutorial, we will explore some examples of modulus on negative number. What is Modulus of Negative number? By omitting the minus sign, one can determine the modulus of a negative...

3 minutes read.

Types Of Structures In C

We can normally store elements of the same datatype with the help of an array in C programming. We can store multiple numbers of elements of a character data type...

3 minutes read.

Matrix Multiplication in C

Matrix Multiplication in C Matrix multiplication in C: Two matrices can be added, subtracted, multiplied, and divided. To do so, we take input from the consumer for row number, column number, first element matrix,...

3 minutes read.

Keywords in C

A keyword is a word that has a predetermined meaning. The C compiler knows the purposes of the keywords. The objectives of these keywords cannot be modified. Keywords are the...

9 minutes read.

Addition of Matrix in C

The mathematical operation of includingor greater matrices is called the addition of matrices. A matrix is a square series of numbers, symbols, words, letters, and different things. In this article,...

3 minutes read.

String Handling functions in C

String :- The String is the collection of characters. Every String ends with the null character, and the String is enclosed in the double quotations .ie, "javaTpoint". If we see any...

5 minutes read.

Binary Search in C with Best and Worst Time Complexity

What is Binary Search? Binary search is an algorithm that is used to find an element in a sorted array efficiently. It has a time complexity of O(log n). It means...

3 minutes read.

memmove() in C

Introduction: In this article we are discuss about the memmove() function in C. This function transfers memory blocks from one location to another. The memmove() function is declared in the...

3 minutes read.