1. Take an array of size 5x5 and initialize it with random numbers of range 1 to 10, now add all the elements of the 2D array and display sum. 2. Calculate the total/sum of all the values in the...


1. Take an array of size 5x5 and initialize it with random numbers of range 1 to 10, now add
all the elements of the 2D array and display sum.
2. Calculate the total/sum of all the values in the array.
Example:
Array:
2 3 5 3 1
4 5 1 2 1
4 7 3 2 0
2 1 1 5 1
1 7 8 9 0
Sum array: 78


3. Sum all the element in each column and display output.
Example:
Array:
2 3 5 3 1
4 5 1 2 1
4 7 3 2 0
2 1 1 5 1
1 7 8 9 0
Sum array:
13 23 18 21 3


4. Perform sum of all the elements of the arrays whose row number and column number
both are odd. Display the final sum.
Example:
Array:
2 3 5 3 1
4 5 1 2 1
4 7 3 2 0
2 1 1 5 1
1 7 8 9 0
Sum array: 13
Note: create function for each task



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here