Q21Comprehension4 Marks3 Sep 2023
Passage
Consider the given pseudocode, two positive integers, and are the input parameters of procedure mystery, where . Study the given pseudocode and answer the subquestions.
```
a = mystery(a, b)
Procedure mystery(X, Y)
if(Y != 0){
return(mystery(Y, doSomething(X, Y)))
}
else {
return(X)
}
End mystery
Procedure doSomething(U, V)
if(U >= V){
C = 0, i = 0
while(C <= U){
i = i + 1
C = V * i
}
D = U - V * (i - 1)
return(D)
}
else {
return(0)
}
End doSomething
```
What will the return value of procedure doSomething(U, V) represent, where ?