×

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

Control statement in C

What is a control statement? A control statement helps us to control the flow of the program. The control statement helps us to execute the program's instructions in a user-defined order....

8 minutes read.

Find occurrence of substring in C using function

Introduction: In this article, we discuss finding the occurrence of a substring in C using function. This software takes strings and substrings as input and counts the occurrences of substrings within...

3 minutes read.

Runtime vs compile time in C

In the C programming language, the often used terms in every step consist of compile time and runtime. The compile time is referred to the source code that will be...

4 minutes read.

Break, continue and goto statement in C

Break statement Break statement is used to break the process of a loop (while, do while and for) and switch case. Syntax: break; Example 1 while(test Expression) { // codes if(condition for break){ break; } // codes } Example 2 For(int it, condition,...

1 minute read.

Double Specifier in C

What is a double specifier? The term double denotes the double data type in C. It more accurately depicts floating point numbers. The idea that it has twice the precision of...

3 minutes read.

Pointer to pointer in C

A pointer to another pointer is another type of multiple indirections and a chain of many pointers. Generally, a pointer consists of the address of the variable. Once a pointer to...

4 minutes read.

Caesar Cipher Program in C

What is Caesar Cipher? The Caesar Cipher is a type of substitution cipher that is named after Julius Caesar, who is said to have used it to encrypt messages sent to...

2 minutes read.

OpenGL in C

OpenGL stands for Open Graphics Library. It is a low-level, widely supported modeling and rendering software package that is widely available across all the platforms. It is an API used...

4 minutes read.

C/C++ Program to Find the Size of int, float, double and char

In this tutorial, we will learn how to use the sizeof operator to determine the size of each variable. Program to Determine Variable Size Write a C or C++ program to determine the...

2 minutes read.

How to create a binary file in C?

Creating a binary file in C language is very simple, requiring only some specific functions to be implemented. There are also other binary modes: read, and write, which will be...

7 minutes read.

Git Hooks

Git Hooks Overview Just like other version control systems, Git has its way to deliver customized scripts whenever some important activity occurs. The hooks act just like the triggers or catalysts...

4 minutes read.

Infix to Postfix program in C

Infix Expression: In infix expression, an operator is placed between the two operands. Example: x + y, here operator + is placed between operands x and y. Postfix Expression: In...

3 minutes read.

Variable in C

Variable is an identifier that holds data in memory. It is used to identify input data in a program. The value of the variable can change at the time of...

2 minutes read.

User Defined Functions in C

C Functions: A function is defined as a block of code that is used to perform some specific task. In functions, we use flower brackets ({}) which contain the set of programming...

5 minutes read.

Nested loop in C

Definition of Nested Loop A nested loop is generally used when we want to run a loop statement inside another loop statement. This kind of loop is also known as a...

3 minutes read.

Limitations of Inline Function in C

The compiler is unable to conduct inlining in two instances. It just accepts the inline definitions and produces space for the function in the same way it does for a...

3 minutes read.

Fee Management System in C

The concept is to split every operation into its very own characteristic. Software is made from all of the capabilities mixed with transfer cases. An example of the capabilities may...

5 minutes read.

Builtin functions of GCC compiler

Certain built-in functions are present in the GCC compiler. These features are as follows: Function_ built in_popcount (x) The number of 1s in data of the integer type can be counted using...

3 minutes read.

Nested Structure in C

In C language, we can create nested Structure (Structure within Structure). There are two ways to define a nested structure. By separate structure By Embedded structure   Separate structure In a separate...

1 minute read.

How to delete a file in C

A file is a group of data kept on a secondary device, such as a hard disc. It is typically utilized as a real-world application with a lot of data. These...

3 minutes read.