Question: Write the program in c++. thanks! 2) Write a program that takes input from the user that represents a numerator and denominator of a fraction.
Write the program in c++. thanks!


2) Write a program that takes input from the user that represents a numerator and denominator of a fraction. Then, reduce the fraction to its lowest form and display it to the screen. If appropriate, display the fraction as a mixed number (3 1/2) To reduce a fraction to its lowest terms, divide the numerator and denominator by the greatest common divisor. The GCD can be calculated by using Euclid's algorithm. Euclid's algorithm states: Let m represent the numerator and n represent the denominator of a fraction. Divide m by n. Save the divisor in m and save the remainder in n. If n is 0, then stop: m contains the GCD. Otherwise repeat the process
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
