Gate2018 cs Q46

0. Consider the following program written in pseudo-code. Assume that x and y are integers:


Note – Numerical Type question

  • Option : A
  • Explanation :
    Count(1024, 1024) will be called and value of x will be deducted by x/2. ‘x’ will be printed 10 times. On count=10, value of x will become 1.
    For every recursively for every y=1023 and count() is called 10times for each y. So, 1023 x 10 = 10230
    Answer is 10230.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *