GATEverse
← GATE IT 2008

Q83

MCQ2 marks, −0.5

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); } } Which of the following implementations will produce the same output for f(173)f(173) as the above code? P1 P2 void f (int n) { if (n/2) { f(n/2); } printf ("%d", n%2); } void f (int n) { if (n <=1) { printf ("%d", n); } else { printf ("%d", n%2); f (n/2); } }

Sign in to save attempts.

Loading…