Open In App

Capgemini | Pseudocode Questions | Question 9

Predict the output of the following pseudo-code if x= 1 and y=2: 

Integer solve(int x, int y) 
if(x > 1) 
  solve(x – 1, y + 3) 
end if 
print y 
End function solve()

(A)



2

(B)



3

(C)

6

(D)

4

Answer: (A)
Explanation:
Quiz of this Question
Please comment below if you find anything wrong in the above post

Article Tags :
Uncategorized