1.

What will be the output of the program?_x000D_ #include_x000D_ int sumdig(int);_x000D_ int main()_x000D_ {_x000D_ int a, b;_x000D_ a = sumdig(123);_x000D_ b = sumdig(123);_x000D_ printf("%d, %d\n", a, b);_x000D_ return 0;_x000D_ }_x000D_ int sumdig(int n)_x000D_ {_x000D_ int s, d;_x000D_ if(n!=0)_x000D_ {_x000D_ d = n%10;_x000D_ n = n/10;_x000D_ s = d+sumdig(n);_x000D_ }_x000D_ else_x000D_ return 0;_x000D_ return s;_x000D_ }

A. 4, 4
B. 3, 3
C. 6, 6
D. 12, 12
Answer» D. 12, 12


Discussion

No Comment Found

Related MCQs