Question: Consider the following recursive function. It accepts two non-negative integers as its input. Explain in your own words what exactly it returns. int mystery
Consider the following recursive function. It accepts two non-negative integers as its input. Explain in your own words what exactly it returns. int mystery (int p, int q){ if (q==0) return p int r = p% q return mystery (q, r) }
Step by Step Solution
There are 3 Steps involved in it
Solution The recursive function mystery returns the greatest common divisor GCD of two nonnegative i... View full answer
Get step-by-step solutions from verified subject matter experts
