- 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 ΔX which is added to numerator and denominator both of fraction (a/b) to convert it to another fraction (c/d)

In this article, we will be discussing a program to find ΔX which is added to the numerator and denominator both of given fraction (a/b) to convert it to another given irreducible fraction (c/d).

For example, let us suppose we have been given with the following values,

a = 4 | b = 2 | c = 4 | d = 3

then ΔX would be 4 such that (a + ΔX)/(b + ΔX) = 8/6 = 2/3

As we know, (a + ΔX)/(b + ΔX) = c/d. Solving this equation for ΔX, we get

ΔX = (bc - ad) / (d - c)

## Example

#include <iostream> using namespace std; int main() { int a = 4; int b = 2; int c = 4; int d = 3; int dif = 0; dif = (b*c-a*d)/(d-c); cout << "The value of \u0394x :" << endl; cout << dif << endl; return 0; }

## Output

The value of Δx : 4

- Related Questions & Answers
- Find ΔX which is added to numerator and denominator both of fraction (a/b) to convert it to another fraction (c/d) in C++
- C program to convert decimal fraction to binary fraction
- Converting a proper fraction to mixed fraction - JavaScript
- Convert decimal fraction to binary number in C++
- C program to represent numbers in numerator and denominator in string format
- Fraction to Recurring Decimal in C++
- Find the multiple of x which is closest to a^b in C++
- Write a C program to reduce any fraction to least terms using while loop
- Program to find common fraction between min and max using given constraint in Python
- Program to count number of fraction pairs whose sum is 1 in python
- Reduce the fraction to its lowest form in C++
- How to display fraction in base R plot?
- Find multiple of x closest to or a ^ b (a raised to power b) in C++
- Fraction module in Python
- K-th Smallest Prime Fraction in C++

Advertisements