Question: Create a C program: Create recursive functions: Add the digits of an integer together. For instance, if the user enters 345, the function will return
Create a C program:
Create recursive functions:
Add the digits of an integer together. For instance, if the user enters 345, the function will return 12 (3 + 4 + 5 = 12). If the user enters 34 the function will return 7 (3 + 4 = 7). Make sure you use recursion.
Given a base and an exponent, calculate the power of a number. Make sure you use recursion.
Do not gather input nor display the results in these functions. All values needed by the functions will be passed in as parameters. Each function should return a value.
Call both functions from the main function:Create a menu system with the following options:
Add the digits of an integer together.
Find the power of a number.
Quit
Gather all user input in main and pass it to the correct method.
Display the results. Include a clear output message.
Repeat the program until the user chooses to quit.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
