Write a function named "reduce" that takes two positive integer arguments, call them "num" and "denom", treats them | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a function named "reduce" that takes two positive integer arguments, call them "num" and "denom", treats them

The function should return the value 0 (to indicate failure to reduce) if either of the two arguments is zero or negative, and should return the value 1 otherwise. Thus, for example, if m and n have been declared to be integer variables in a program, then m = 25; n = 15; if (reduce(m,n)) cout << m << '/' << n << endl; else cout << "fraction error" << endl; will produce the following output: 5/3 Note that the values of m and n were modifi

17th Apr 2018, 7:25 AM
Mofumadi Lerato
Mofumadi Lerato - avatar
3 Answers
+ 3
Is this some kind of challange or just your homework?
17th Apr 2018, 7:40 AM
Jakub Stasiak
Jakub Stasiak - avatar
+ 2
I smell homework. It's not even 0.5 of a challenge.
17th Apr 2018, 8:50 AM
non
0
hey do your own homework >:(
17th Apr 2018, 4:11 PM
hinanawi
hinanawi - avatar