- 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

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%

- Related Questions & Answers
- Program to find compound interest in C++
- C Program for the compound interest?
- What are the differences between interest rate and annual percentage rate?
- C Program for compound interest?
- Python Program for compound interest
- Java Program to calculate Compound Interest
- Compare fixed interest rate and floating interest rate
- 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++
- What is Interest Rate Risk?
- Find total number of distinct years from a string in C++ Program
- Find total number of distinct years from a string in C++

Advertisements