MCQOPTIONS
Saved Bookmarks
| 1. |
What will be the output of the program? #include<stdio.h> int sumdig(int); int main() { int a, b; a = sumdig(123); b = sumdig(123); printf("%d, %d n", a, b); return 0; } int sumdig(int n) { int s, d; if(n!=0) { d = n%10; n = n/10; s = d+sumdig(n); } else return 0; return s; } |
| A. | 4, 4 |
| B. | 3, 3 |
| C. | 6, 6 |
| D. | 12, 12 |
| Answer» D. 12, 12 | |