GATE | Gate IT 2008 | Question 79
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); } } |
chevron_right
filter_none
What does f(173) print?
(A) 010110101
(B) 010101101
(C) 10110101
(D) 10101101
Answer: (D)
Explanation: (173)2 = 10101101
Quiz of this Question
Recommended Posts:
- GATE | GATE CS 2008 | Question 35
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 17
- GATE | GATE CS 2008 | Question 16
- GATE | GATE CS 2008 | Question 15
- GATE | GATE CS 2008 | Question 14
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 12
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 10
- GATE | GATE CS 2008 | Question 9
- GATE | GATE CS 2008 | Question 8
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE CS 2008 | Question 5



