Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago