C++ Program To Find Compound Interest Last Updated : 29 Jul, 2024 Comments Improve Suggest changes Like Article Like Report Try it on GfG Practice What is 'Compound interest'? Compound interest is the addition of interest to the principal sum of a loan or deposit, or in other words, interest on interest. It is the result of reinvesting interest, rather than paying it out, so that interest in the next period is then earned on the principal sum plus previously-accumulated interest. Compound interest is standard in finance and economics.Compound interest may be contrasted with simple interest, where interest is not added to the principal, so there is no compounding.Compound Interest formula:Formula to calculate compound interest annually is given by: Amount= P(1 + R/100)tCompound Interest = Amount - PWhere, P is principal amount R is the rate and T is the time spanPseudo Code:Input principal amount. Store it in some variable say principal.Input time in some variable say time.Input rate in some variable say rate.Calculate Amount using formula, Amount = principal * (1 + rate / 100)time.Calculate Compound Interest using Formula.Finally, print the resultant value of CI.Example:Input: Principal (amount): 1200 Time: 2 Rate: 5.4Output: Compound Interest = 133.099243 C++ // C++ program to find compound interest // for given values. #include <bits/stdc++.h> using namespace std; // Driver code int main() { double principal = 10000, rate = 5, time = 2; // Calculate compound interest double A = principal * ((pow((1 + rate / 100), time))); double CI = A - principal; cout << "Compound interest is " << CI; return 0; } // This Code is Contributed by Sahil Rai. Output: Compound interest is 1025Time complexity: O(n), as pow() function take O(N) time.Auxiliary space: O(1). Comment More infoAdvertise with us Next Article C++ Program To Find Compound Interest K kartik Follow Improve Article Tags : C++ Programs C++ C Basic Programs Practice Tags : CPP Similar Reads C++ Program To Find Simple Interest What is 'Simple Interest'? Simple interest is a quick method of calculating the interest charge on a loan. Simple interest is determined by multiplying the daily interest rate by the principal by the number of days that elapse between payments. Simple Interest formula: Simple interest formula is giv 2 min read C++ Program To Find Sum of First N Natural Numbers Natural numbers are those positive whole numbers starting from 1 (1, 2, 3, 4, ...). In this article, we will learn to write a C++ program to calculate the sum of the first N natural numbers. AlgorithmInitialize a variable sum = 0.Run a loop from i = 1 to n.Inside the loop, add the value of i to the 1 min read C++ Program For Fibonacci Numbers The Fibonacci series is the sequence where each number is the sum of the previous two numbers. The first two numbers of the Fibonacci series are 0 and 1, and they are used to generate the entire series.Examples:Input: 5Output: 5Explanation: As 5 is the 5th Fibonacci number of series 0, 1, 1, 2, 3, 5 5 min read C/C++ program for calling main() in main() Given a number N, the task is to write C/C++ program to print the number from N to 1 by calling the main() function using recursion.Examples: Input: N = 10 Output: 10 9 8 7 6 5 4 3 2 1Input: N = 5 Output: 5 4 3 2 1 Approach:Use static variable to initialise the given number N.Print the number N and 2 min read C++ Program to Perform Calculations in Pure Strings Given a string of operations containing three operands for each operation "type of command", "first operand", and "second operand". Calculate all the commands given in this string format. In other words, you will be given a pure string that will ask you to perform an operation and you have to perfor 5 min read Like