Text: For example, if n = 2345, return 4689. If n = 6758, return 9999. Please use C.
The functions you need to complete in this lab must be implemented using recursion. Do not use global (or static variables).
Practice Problem: You do not need to submit solutions for practice problems during the lab. The teaching assistants will solve these problems if requested.
Complete the implementations of the following functions and use assert in main to provide at least five tests per function, including edge cases.
// all_digits_even(n) returns true exactly when all decimal digits of n are even. // requires: <= n < 10^9 bool all_digits_even(int n);
// digit_sum(n) returns the decimal sum of the digits in n. // requires: <= n < 10^9 int digit_sum(int n);
Marked Problems: The lab instructors will provide help implementing the following functions but will not provide code for them directly. You should take advantage of feedback from the lab instructors before the deadline.
Complete implementations of the following functions:
// first_digit(n) returns the first decimal digit of n. // requires: <= n < 10^9 int first_digit(int n);
// double_digits(n) returns the number consisting of the decimal digits of n doubled, so l23 becomes 246; digits 5 to 9 should be replaced with 9. // requires: <= n < 10^9 int double_digits(int n);
Provide at least five tests per function, including edge cases.
Provide a comment at the bottom of your code describing how your implementations work using complete sentences. You will be marked on if your description demonstrates an understanding of your code.