0% found this document useful (0 votes)
20 views1 page

Exercise: Q: Make Two 4x4 Arrays Having Names Ary1 and Ary2. Initialize Both The Arrays by Taking Input From User

This document describes how to write a function that adds the corresponding elements of two 4x4 arrays, ary1 and ary2, input by the user. The function is called sumArray and takes ary1 and ary2 as parameters. It adds the elements and stores the results in a new 4x4 array called resultantArray. The function then displays the elements of resultantArray.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

Exercise: Q: Make Two 4x4 Arrays Having Names Ary1 and Ary2. Initialize Both The Arrays by Taking Input From User

This document describes how to write a function that adds the corresponding elements of two 4x4 arrays, ary1 and ary2, input by the user. The function is called sumArray and takes ary1 and ary2 as parameters. It adds the elements and stores the results in a new 4x4 array called resultantArray. The function then displays the elements of resultantArray.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise

Q: Make two 4x4 arrays having names ary1 and ary2. Initialize both the arrays by taking input from user.
Declare a function with the name sumArray .
Pass the two arrays ary1 and ary2 to the function. This function should add the values of the
corresponding cell of the two arrays, and store the result in a new array named resultantArray . Also the
function should display the elements of the resultantArray on the screen.
Consider the two arrays below. Your resultantArray should look like as follow.

1
5
9
13

2
6
10
14

3
7
11
15

4
8
12
16

1
5
9
13

Ary1

Ary2

resultantArray
2
10
18
26

2
6
10
14

4
12
20
28

6
14
22
30

8
16
24
32

3
7
11
15

4
8
12
16

You might also like