- 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 are going to write a program that calculates ∆ X value that satisfies the given equation. The equation is (a + ∆ X)/(b + ∆ X) = c/d.

Here, we need a little bit of math to solve the equation. And it's straightforward. Cross multiply and take ∆X to one side.

You will get the value of ∆X as (b*c-a*d)/(d-c).

We are given a, b, c, and d values. Finding \Delta XΔX value is straightforward.

Let's see the code.

#include <bits/stdc++.h> using namespace std; int findTheXValue(int a, int b, int c, int d) { return (b * c - a * d) / (d - c); } int main() { int a = 5, b = 2, c = 8, d = 7; cout << findTheXValue(a, b, c, d) << endl; return 0; }

If you run the above code, then you will get the following result.

19

If you have any queries in the tutorial, mention them in the comment section.

- Related Questions & Answers
- 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)
- C program to convert decimal fraction to binary fraction
- Convert decimal fraction to binary number in C++
- Converting a proper fraction to mixed fraction - JavaScript
- Fraction to Recurring Decimal in C++
- Find the multiple of x which is closest to a^b in C++
- C program to represent numbers in numerator and denominator in string format
- Reduce the fraction to its lowest form in C++
- K-th Smallest Prime Fraction in C++
- Find four elements a, b, c and d in an array such that a+b = c+d in C++
- Find all pairs (a,b) and (c,d) in array which satisfy ab = cd in C++
- Find multiple of x closest to or a ^ b (a raised to power b) in C++
- Fraction module in Python
- Find largest d in array such that a + b + c = d in C++
- Write a C program to reduce any fraction to least terms using while loop

Advertisements