A simple program that takes in a numerator and denominator and then computes the GCD for that fraction is Enter your and then Enter your denominator: zero Invalid input, denominator can't be zero.
What is numerator and denominator in programming?
- Enter your denominator: zero Invalid input, denominator can't be zero.
- Enter your denominator: 3
- The lowest phrases of your fraction: 34/3
- Enter your denominator: 6.
- The lowest phrases of your fraction: 1/2
- ++ Code
- # include
- # include
- the use of namespace std;
- // Function to calculate GCD
- int g_c_d(int num1, int num2)
- go back num2;
- if (num2 == 0)
- go back num1 if (num1 == num2)
- go back num1;
- // Function to lessen to fraction to lowest phrases
- bool to_lowest_terms(int &numerator, int &denominator)
- {
- if (denominator == 0)
- if (numerator == 0)
- cout << "nThe lowest phrases of your fraction: " << 0 xss=removed> 0 && denominator > 0);
- numerator = abs(numerator);
- denominator = abs(denominator);
- int factor = g_c_d(numerator, denominator)
Read more about GCD :
https://brainly.com/question/219464
#SPJ1