Question: Write a Ch program that takes two positive integers from an interactive user, call them nur and denom, treats them as the numerator and denominator

 Write a Ch program that takes two positive integers from an

Write a Ch program that takes two positive integers from an interactive user, call them "nur" and "denom", treats them as the numerator and denominator of a fraction, and reduces the fraction by dividing numerator and denominator by the greatest common divisor of the two integers (le, the largest positive integer that divides each of the integers). The program should display a message "fraction error" to indicate failure to reduce if either of the two arguments is zero or negative and should display the fraction after reduction otherwise. For example, if num and denom have been declared to be integer variables in the program, then num - 9: denom 6 The program will produce the following output: 3/2 The program will display the same fraction if there is no common divisor Hint 1: for successful output use, cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!