Prepare a function named reduce that takes two positive


Problem

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 commondivisor of the two integers. The function should return the value 0 (to indicate failure to reduce) ifeither of the two arguments is zero or negative, and should return the value 1 otherwise.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Prepare a function named reduce that takes two positive
Reference No:- TGS02745494

Now Priced at $15 (50% Discount)

Recommended (92%)

Rated (4.4/5)