Vidyalelo
Data Structure · Q144

Miscellaneous on Data Structures

Programming · Data Structure · question 144

Q144

What is the output of the following code? #include int recursive_sum_of_digits(int n) if(n == 0) return 0; return n % 10 + recursive_sum_of_digits(n/10); int main() int n = 10000; int ans = recursive_sum_of_digits(n); printf("%d",ans); return 0;

A.
0
B.
1
Answer
C.
runtime error
D.
-1

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board