Puzzle DB17


Multiply corresponding elements in two integer arrays to determine the elements of a third

[E-4]Write a function that has three integer arrays as argments. The function multiplies corresponding elements of two of first two arrays to compute the elements of the third array. All three arrays are the same size. Sample output:

x:
   0    1    2    3    4    5    6    7    8    9
  10   11   12   13   14   15   16   17   18   19
  20   21   22   23   24

y:
  11   10    9    8    7    6    5    4    3    2
   1    0   -1   -2   -3   -4   -5   -6   -7   -8
  -9  -10  -11  -12  -13

z:
   0   10   18   24   28   30   30   28   24   18
  10    0  -12  -26  -42  -60  -80 -102 -126 -152
-180 -210 -242 -276 -312

The first two arrays were initialized using fillArrayInOrder() and fillArrayDescending().



Answer         Next Page         Previous Page Home