61
GB
What is the output: int f(int n){return n==1?1:f(n/2)+(n%2);} cout<
IN
आउटपुट क्या है: int f(int n){return n==1?1:f(n/2)+(n%2);} cout
A
3
3
B
7
7
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
f(7)=f(3)+1=f(1)+1+1=1+1+1=3. Output: 3.
व्याख्या (हिन्दी)
f(7)=f(3)+1=f(1)+1+1=1+1+1=3. आउटपुट: 3.