Define recursive function. Write a recursive function (in C) to find the sum of digits of an integer starting from the LSD (least significant digit) to MSD (most significant digit) till you find an odd digit.
Define recursive function. Write a recursive function (in C) to find the sum of digits of an
integer starting from the LSD (least significant digit) to MSD (most significant digit) till
you find an odd digit. (Example: input: 34222 output:6; input:22243 output:0)
Hint:the rightmost digit in an integer is called LSD, and the leftmost digit is called MSD.Define recursive function. Write a recursive function (in C) to find the sum of digits of an
integer starting from the LSD (least significant digit) to MSD (most significant digit) till
you find an odd digit. (Example: input: 34222 output:6; input:22243 output:0)
Hint:the rightmost digit in an integer is called LSD, and the leftmost digit is called MSD.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps