0% found this document useful (0 votes)
15 views

Programming Assesment

The document contains 6 questions about operations on 2D arrays in C++ including finding maximum/minimum values in rows/columns of a matrix, summing elements above and below the diagonal of a matrix, sorting a 3x3 array, multiplying two 3x3 arrays and storing the result, displaying prime numbers in a 3x3 array, and deleting a column from a matrix based on user input.

Uploaded by

Azhar Elahi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Programming Assesment

The document contains 6 questions about operations on 2D arrays in C++ including finding maximum/minimum values in rows/columns of a matrix, summing elements above and below the diagonal of a matrix, sorting a 3x3 array, multiplying two 3x3 arrays and storing the result, displaying prime numbers in a 3x3 array, and deleting a column from a matrix based on user input.

Uploaded by

Azhar Elahi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Q1. Find the maximum number in each row and minimum in each column in the given matrix below.

You can use the variables called min, max to store the minimum and maximum numbers for each
row and column. Display the result in the following format.

34 56 20 33 18 Max
56
89 35 67 23 54
89
67 42 56 76 90
90
56 78 14 79 11
79

Min 34 35 14 23 11
Q2. Declare a 2-Dimensional array of integer numbers. The array consists of 5 rows and 5
columns. Write a C++ program to find out the sum of all elements of 2D-array above
and below the diagonal shown in the figure:

34 56 20 33 18
89 35 67 23 54
67 42 56 76 90
56 78 14 79 11
13 67 84 99 73

Q3. Write a program in C++ to sort a two dimensional array i.e.3x3 in an ascending
order

Q4. Write a program in C++ to multiply a two dimensional array i.e.3x3 and store
the result in the other array and finally display the resultant matrix.

Q5. Write a program in C++ to display the prime numbers in 3x3 array.

Q6. write a program in C++ to delete a specific column upon user choice and display
rest of the column in the matrix.

You might also like