Question: Question 2: 10 Marks Write a C++ program that creates a two-dimensional array mat of type int, having 4 rows and 5 columns. After that

 Question 2: 10 Marks Write a C++ program that creates a

Question 2: 10 Marks Write a C++ program that creates a two-dimensional array "mat" of type int, having 4 rows and 5 columns. After that get input in this 2D array from the user. Create a function named arr-pass and pass the whole array to function. In the function access the array, then sort row-o and row-2 of the 2D array in ascending order. Sort row-1 and row-3 in descending order. In the end, display the sorted 2D array on the screen in tabular form. Sample Inputs: Enter Values in the table: 21, 12, 9, 1,7 5, 67, 87,3,28 15, 81, 9,23,6 71, 11, 4, 2, 11 Sample Outputs: Sorted table is: 1,7,9,12, 21 87,67, 28, 5,3 6, 9, 15, 23, 81 71, 11, 11, 4,2 Note: Use only While loop in whole program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!