Skip to content
Related Articles

Related Articles

GATE | Gate IT 2008 | Question 79

Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

Consider the code fragment written in C below :




void f (int n)
  if (n <=1)  {
   printf ("%d", n);
  }
  else {
   f (n/2);
   printf ("%d", n%2);
  }
}


What does f(173) print?

(A) 010110101
(B) 010101101
(C) 10110101
(D) 10101101


Answer: (D)

Explanation: (173)2 = 10101101

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!