ISRO | ISRO CS 2020 | Question 34

Consider the following recursive C function that takes two arguments

unsigned int rer (unsigned int n, unsigned int r) {
  if (n > 0) return (n% r + rer(n/r, r));
  else return 0;
 } 

What is the return value of the function rer when it is called as rer (513, 2) ?
(A) 9
(B) 8
(C) 5
(D) 2


Answer: (D)

Explanation:

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.