Question:
Write a definition for a function SUMMIDCOL(int MATRIX[][10],int N,int M) in C++, which finds the sum of the middle column’s elements of the MATRIX (Assuming N represents number of rows and M represents number of columns, which is an odd integer).
Example: if the content of array MATRIX having N as 5 and M as 3 is as follows:
| 1 | 2 | 1 |
| 2 | 1 | 4 |
| 3 | 4 | 5 |
| 4 | 5 | 3 |
| 5 | 3 | 2 |
The function should calculate the sum and display the following:
Sum of Middle Column: 15
C. Sir| Created: 3-Jan-2019 | Updated: 22-Mar-2026|CBSE12A-2017
