Question: In C++ please The given progtam defines an GCDO function that retums the greatest common divisor of two integers. Ex GCD(12,8) returns 4, the greatest
The given progtam defines an GCDO function that retums the greatest common divisor of two integers. Ex GCD(12,8) returns 4, the greatest number that evenly divides both 12 and 8 . Write a Reducefractiong function with two integer parameters, numerator and denominator, representing a fraction. The function should call the given GCDO function to find the GCD of the numerator and denominator. Then the function should divide the numerator and denominator by the 6C0. Ex. If num = 2 and den =4, calling Reducefraction(num, den) should assign num = 1 and den = 2 because the fraction 2/4 reduces to 1/2 The proglam should read two integers, representing the numerator and denominator, as input and call Reducefraction0 with the integers. Theprogram should output the reduced numerator and denominator separated by a forward shash Ex if the input is 24 . then the output is: 1/2 Ex it the input is 10.15, then the output is 2/3 Your program must define and call the function: void ReduceFraction (ints numerator, ints denominator)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
