Question: Write a program that reads two fractions, adds them, and prints the result so that the numerator and denominator have no common factor. For example,
Write a program that reads two fractions, adds them, and prints the result so that the numerator and denominator have no common factor. For example, when adding 3/4 and 5/6, the result is 19/12. Use helper functions for obtaining the numerator and denominator of strings such as "3/4", and for computing the greatest common divisor of two integers.
Step by Step Solution
3.34 Rating (160 Votes )
There are 3 Steps involved in it
Here is a sample implementation in Python def gcda b Compute the greatest common divisor of a and b ... View full answer
Get step-by-step solutions from verified subject matter experts
