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
Live Demo
#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 Articles
- Find ΔX which is added to numerator and denominator both of fraction (a/b) to convert it to another fraction (c/d) in C++
- A fraction becomes $\frac{9}{11}$ if 2 is added to both numerator and the denominator. If 3 is added to both the numerator and the denominator, it becomes $\frac{5}{6}$. Find the fraction.
- A fraction becomes $\frac{1}{3}$ if 1 is subtracted from both its numerator and denominator. If 1 is added to both the numerator and denominator, it becomes $\frac{1}{2}$. Find the fraction.
- The numerator of a fraction is 3 less than the denominator. If 2 is added to both the numerator and the denominator, then the sum of the new fraction and the original fraction is $\frac{29}{20}$. Find the original fraction.
- Find the equivalent fraction of \( \frac{3}{5} \) having(a) denominator 20 (b) numerator 9(c) denominator 30 (d) numerator 27
- Find the equivalent fraction of \( \frac{13}{7} \) havinga. numerator 52 .b. denominator 49.c. numerator 130.d. denominator 63.
- When 3 is added to the denominator and 2 is subtracted from the numerator a fraction becomes $\frac{1}{4}$. And, when 6 is added to numerator and the denominator is multiplied by 3, it becomes $\frac{2}{3}$. Find the fraction.
- The numerator of a fraction is 6 less than the denominator. If 3 is added to the numerator, the fraction is equal to $\frac{2}{3}$. What is the original fraction equal to?
- C program to convert decimal fraction to binary fraction
- The denominator of a fraction is 4 more than twice its numerator. Denominator becomes 12 times the numerator. If both the numerator and the denominator are reduced by 6. Find the fraction.
- In a fraction, twice the numerator is 2 more than the denominator. If 3 is added to the numerator and denominator the new fraction is $\frac{2}{3}$. Find the original fractions.
- If 2 is added to the numerator of a fraction, it reduces to $\frac{1}{2}$ and if 1 is subtracted from the denominator, it 1 reduces to $\frac{1}{3}$. Find the fraction.
- The sum of a numerator and denominator of a fraction is 18. If the denominator is increased by 2, the fraction reduces to $\frac{1}{3}$. Find the fraction.
- The denominator of a fraction is 7 more than its numerator. If '1' is subtracted from both the numerator and the denominator, it becomes $\frac{9}{6}$. Form an equation to find the value of the actual fraction.
- The sum of numerator and denominator of a fraction is 3 less than twice the denominator. If each of the numerator and denominator is decreased by 1, the fraction becomes $\displaystyle \frac{1}{2}$, find the fraction.
Kickstart Your Career
Get certified by completing the course
Get Started