Post

EntropicX
EntropicX@mauro_zallocco·
@Python_Dv solve(20,50) -> solve(50%20,20) ie solve(10,20) -> solve(20%10,10) ie solve(0,10) returning 10. A
English
0
0
0
122
Rakesh Das
Rakesh Das@RakeshDas_18·
@Python_Dv A. 10 is the output. Reason: 1. The solve() function calculates the greatest common divisor (GCD) of a and b using the Euclidean algorithm. 2. For the input values a = 20 and b = 50, the GCD is 10. Therefore, the output is 10.
English
0
0
0
80
Ayush
Ayush@ayush152002·
@Python_Dv Option A will be the correct answer This is a recursion problem which will go on until b%a become zero and a becomes 10
English
0
0
0
68
PythonicJourney
PythonicJourney@pythonicjourney·
@Python_Dv 10. This function appears to be using recursion to find the GCD of two numbers a and b using the Euclidean algorithm. Here's how it works: If a is equal to 0, then the GCD is b. Otherwise, it recursively calls itself with b % a as the new value of a and a as the new value of b.
English
0
0
0
4
R. Stephen Ruiz
R. Stephen Ruiz@rslruiz·
@Python_Dv A: 10 """ recursive calls: solve(20, 50) -> solve(10, 20) -> solve(0, 10) -> 10. """
English
0
0
0
29
Paylaş