151
GB
What is the output: int f(int n){ return n?n+f(n-1):0; } cout<
IN
आउटपुट क्या है: int f(int n){ return n?n+f(n-1):0; } कोउट
A
10
10
B
4
4
C
24
24
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
f(4)=4+f(3)=4+3+f(2)=4+3+2+f(1)=4+3+2+1+f(0)=4+3+2+1+0=10.
व्याख्या (हिन्दी)
f(4)=4+f(3)=4+3+f(2)=4+3+2+f(1)=4+3+2+1+f(0)=4+3+2+1+0=10.