6 20 Points Write C Program Called Powercpp Compute 2 Nonnegative Integer N Program Develo Q43872162

6. (20 points) Write a C++ program called power.cpp to compute 2″ for a nonnegative integer n. In this program, you have to develop a recursive function to calculate it. And also, you can’t use a library in the program. For the problem, you can assume that the user always enter a correct integer number which is greater than or equal to zero. [Hint: Use the formula: 2″ = 2*2″-1 for the recursive function.] Here are some sample test cases: Page 2 of 4 Test case 1 Enter a number: 0 Result: 1 Test case 2 Enter a number: 4 Result: 16 Test case 3 – We read your program and check if it uses a recursive function. Show transcribed image text 6. (20 points) Write a C++ program called power.cpp to compute 2″ for a nonnegative integer n. In this program, you have to develop a recursive function to calculate it. And also, you can’t use a library in the program. For the problem, you can assume that the user always enter a correct integer number which is greater than or equal to zero. [Hint: Use the formula: 2″ = 2*2″-1 for the recursive function.] Here are some sample test cases: Page 2 of 4 Test case 1 Enter a number: 0 Result: 1 Test case 2 Enter a number: 4 Result: 16 Test case 3 – We read your program and check if it uses a recursive function.
Expert Answer
Answer to 6. (20 points) Write a C++ program called power.cpp to compute 2″ for a nonnegative integer n. In this program, you have…
OR