
please wait
b==0
is the conditionala
will be returned if b == 0
gcd(b, a % b)
will be returned if b != 0
A = 50, B = 45
:int gcdAnswer = gcd( 50, 45 )
return 45 == 0 ? 50: gcd( 45 , 50%45 );
45 == 0
is false, the second expression will be returned from the function:gcd( 45 , 50%45 );
return /*(of 1st function call)*/ = gcd( 45 , 5 )
return 5 == 0 ? 45: gcd( 5, 45%5);
45 == 0
is false, the second expression will be returned from the function:gcd( 5, 45%5 );
return /*(of 1st function call)*/ = return /*(of 2nd function call)*/ = gcd( 5, 0 )
return 0 == 0 ? 5: gcd( 0, 5%0);
0 == 0
is true, the firstexpression will be returned from the function:5
return /*(of 1st function call)*/ = return /*(of 2nd function call)*/ = gcd( 5, 0 ) = 5