Question: This have to be in C++ language Take your time, Thanks 6. Write a function named reduce that takes two positive integer arguments, call them


This have to be in C++ language Take your time, Thanks
6. Write a function named "reduce" that takes two positive integer arguments, call them "num" and "denom", treats them as the numerator and denominator of a fraction, and reduces the fraction. That is to say, each of the two arguments will be modified by dividing it by the greatest common divisor of the two integers. The function should return the value 0 (to indicate failure to reduce) if either of the two arguments is zero or negative, and should return the value 1 otherwise. Thus, for example, if m and n have been declared to be integer variables in a program, then 1 m = 25; 2. n = 15; 3. if (reduce(m, n)) 4. cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
