Output of C-language code
What will be the output of the below code ? int* myFunc() { int x = 2; return &x; } main() { int* p = myFunc(); printf(“%d”, *p); } No! that the answer if not 2 :).
Recursive function to compute sum of digis in a number
Write a function which should accept an integer and should return the sum of digits in that integer. This function should compute the sum of digits recursively. For example: Input Output ——– ———– 56 11 (5+6) 1234 10 (1+2+3+4)