- Related Questions & Answers
- Program to find compound interest in C++
- What are the differences between interest rate and annual percentage rate?
- C Program for the compound interest?
- C Program for compound interest?
- Python Program for compound interest
- Java Program to calculate Compound Interest
- Compare simple interest and compound interest.
- Write the difference between discount rate and interest rate.
- Differentiate between rate of interest and internal rate of return.
- Calculate compound interest in JavaScript
- Program to find the Discount Percentage in C++
- Find total number of distinct years from a string in C++ Program
- Find total number of distinct years from a string in C++
- Find percentage from marks in MySQL
- C Program for simple interest?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this tutorial, we will be discussing a program to find the rate percentage from compound interest of the consecutive years.

For this, we will be provided with two integers say A and B that are the interests of two consecutive years. Our task is to find the rate of interest for the given values.

Finding the relation between the given values and eliminating the principal amount, we get the formula as

**rate = ((B-A)*100)/A**

#include <bits/stdc++.h> using namespace std; //calculating the rate of interest float calc_rate(int N1, int N2) { float rate = (N2 - N1) * 100 / float(N1); return rate; } int main() { int N1 = 15, N2 = 18; cout << calc_rate(N1, N2) << "%" << endl; return 0; }

20%

Advertisements