Question:medium

What is the output of the following recursive function? \[ \texttt{int\ func1(int\ num1,\ int\ num2)} \]
return (num2 == 0) ? num1 : func1(num2, num1 % num2);
  

Show Hint

Euclid's Algorithm: \[ GCD(a,b)=GCD(b,a\bmod b) \] until \(b=0\).
Updated On: Jun 25, 2026
  • Factorial of num1
  • Fibonacci numbers from num1 to num2
  • GCD of num1 and num2
  • LCM of num1 and num2
Show Solution

The Correct Option is C

Solution and Explanation

Was this answer helpful?
0