- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

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

# C++ program to find the rate percentage from compound interest of consecutive years

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**

## Example

#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; }

## Output

20%

- Related Questions & Answers
- What are the differences between interest rate and annual percentage rate?
- Program to find compound interest in C++
- Java Program to Calculate the Compound Interest
- C Program for the compound interest?
- Java Program to calculate Compound Interest
- C Program for compound interest?
- Python Program for compound interest
- Java Program to calculate Simple Interest and Compound Interest
- Compare fixed interest rate and floating interest rate
- Compare simple interest and compound interest.
- Calculate compound interest in JavaScript
- Write the difference between discount rate and interest rate.
- Differentiate between rate of interest and internal rate of return.
- What is the concept of interest rate swaps?
- What is Interest Rate Risk?

Advertisements