Multi-dimensional array
These arrays are capable of storing data in rows & columns. Each row in the array is associated with how many columns you have defined for the array, the only drawback is the fact that the entire array must contain elements of some database which is defined when you declare the array.
Declaration of two-dimensional array
<datatype><array-name[size1][size2]>
QUESTION:- Addition and multiplication of an array
OUTPUT
enter a number for array: 5
enter a 5 array:
1 4 7 8 9 6
enter a second 5 array:
2 3 6 9 8 5
Sum the array
The Sum of [0] location array is 7
the multiplication of 1 with 6 arrays is 6
The Sum of [1] location array is 6
the multiplication of 4 with 2 arrays is 8
The Sum of [2] location array is 10
the multiplication of 7 with 3 arrays is 21
The Sum of [3] location array is 14
the multiplication of 8 with 6 arrays is 48
The Sum of [4] location array is 18
the multiplication of 9 with 9 arrays is 81
0 Comments