Question: 21 Write a C++ program to do the following: Declare a two-dimensional array of type double named arr with 4 rows and 4 columns Read

21 Write a C++ program to do the following: Declare a two-dimensional array of type double named arr with 4 rows and 4 columns Read values for array arr from the keyboard. Print the number of 1's in the main diagonal elements (using loop). Update the values of the second row by subtracting 2 from all the elements. Print Array art elements in matrix form, 4 elements on each line. (9 Points) A sample run for the program Main Diagonal Enter values for array arr: 5 6 9 3 8 7 5 14 5 1 0 9 1 1 Number of l's in the main diagonal elements is : 2 Array arr elements after updating the values of the second row: 4 5 6 5 3 4 5 1 1 4 1 mo- 2 Enter your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
