Assignment # 6 Arrays
Assignment # 6 Arrays
Arrays
1. An array A[10][20] is stored in memory with each element requiring 2 bytes of storage. If the
base address of array in the memory is 400 , determine the location of A[5][10] when array is
stored in
(a) Row Major order
(b) Column Major order
2. Write a user defined function named New() which takes a two dimensional array as an
argument and the output shows all zeroes in the upper half.
For eg if the array entered is
6 3 2 1 8
9 4 7 9 3
A= 5 7 0 5 3
6 9 3 2 1
7 5 4 3 9
0 0 0 0 0
9 0 0 0 0
5 7 0 0 0
6 9 3 0 0
7 5 4 3 0
PROGRAMS
3. Do all sorting and merging techniques as given in the book
4. WAP to :
(i) add two matrices
(ii) subtract two matrices
(iii) Display the row sum and column sum of the matrices
(iv) Display the transpose of a matrix
(v) Display the diagonal elements of a matrix