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

Array Assignment (2D)

The document describes a menu driven C++ program to perform various operations on two dimensional arrays: 1) Input elements into a 2D array of size m x n 2) Display, sum rows and columns of a 2D array 3) Create the transpose of a 2D array 4) Calculate the left and right diagonal sums of a square 2D array 5) Display multiplication of row elements of a 2D array 6) Print the upper half of a 2D array 7) Display the middle row and column of a square 2D array

Uploaded by

amishadalal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Array Assignment (2D)

The document describes a menu driven C++ program to perform various operations on two dimensional arrays: 1) Input elements into a 2D array of size m x n 2) Display, sum rows and columns of a 2D array 3) Create the transpose of a 2D array 4) Calculate the left and right diagonal sums of a square 2D array 5) Display multiplication of row elements of a 2D array 6) Print the upper half of a 2D array 7) Display the middle row and column of a square 2D array

Uploaded by

amishadalal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ARRAY ASSIGNMENT (2D)

1 Write a menu driven C++ program to do following operation on two dimensional array A of size m x n. You should use user-defined functions which accept 2- array A! and its size m and n as arguments. "he options are# "o input elements into matrix of size m x n "o display elements of matrix of size m x n $um of all elements of matrix of size m x n "o display row-wise sum of matrix of size m x n "o display column-wise sum of matrix of size m x n "o create transpose of matrix % of size n x m 2 Write user defined functions for s&uare matrix to calculate 'eft diagonal sum (ight diagonal sum 3 4 Write a user-defined function in C++ to display the multiplication of row element of two-dimensional array A)*+),+ containing integer. Write a user defined function named -pper-half./ which ta0es a two dimensional array A! with size 1 rows and 1 columns as argument and prints the upper half of the array. e.g., 22345 63423 24673 53453 2*934 5 22345 3423 "he output will 8e 3 6 7 53 4

Write a function in C++ which accepts a 2 array of integers and its size as arguments and displays the elements of middle row and the elements of middle column. )Assuming the 2 Array to 8e a s&uare matrix with odd dimension i.e. 2x2! 4x4! 6x6 etc...+

You might also like