Question: C++ programming Question 1. Write a program which creates a 4x4 2D array of integers. Your program should then fill the array with random values
C++ programming
Question 1. Write a program which creates a 4x4 2D array of integers. Your program should then fill the array with random values between 1 and 100. After that, you should print out your array as follows:
23 65 39 95
34 54 37 15
12 93 73 66
76 85 47 64
Then, you should print out the sum of each row in the array. For example, with the above array, this would print out:
222
140
244
272
You my break up your solutions into function if you wish, or put all of the code in a single main.
Question 2:
Write a recursive power function which takes an integer and raises it to an integer power (for example, 34 = 3 * 3* 3 * 3 = 81 ). The prototype for this function should be:
int power(int base, int exp);
You may assume that base and exp are both non-negative values. Your function must be recursive in order for you to get credit for your solution.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
