Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop a C program that performs the following: - Create a recursive programmer-defined function named rec power, which recursively computes the Power of two integers
Develop a C program that performs the following: - Create a recursive programmer-defined function named rec power, which recursively computes the Power of two integers and returns the result. - Create a recursive programmer-defined function named is prime which returns 1 if a number is prime and 0 otherwise (the function has at most 2 parameters) - Write a recursive function int count_digits(int) to count the number of digits for a given number. - Create a program, that display the following menu: Please select one of the following options 1: Calculate Power 2: Check if a number is prime 3: Count the number of digits in an integer 4: Exit o If the user selects option 1: prompt the user to enter two integers, then call the function rec_power and print the returned result. - If the user selects option 2: prompt the user to enter an integer, then call is_prime and print the result. - If the user selects option 3: prompt the user to enter an integer, then call count_digits to print the number of digits of in the integer - If the user selects option 4 exit the Program. - keep showing the menu to the user until the user enters 4 to exit the program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started