Summing 2 arrays ( Defining and manipulating your own one dimensional arrays. )
ID: 3634741 • Letter: S
Question
Summing 2 arrays ( Defining and manipulating your own one dimensional arrays. )Get the input file “inputNumbers.txt”. Write a program to read in the first 50 numbers into one array, then read the next 50 numbers into a second array. Create a new third array that will contain the sum of the corresponding values of the first 2 arrays. Print: First array number, Second array number and then the sum that is stored in the third array, print the second number stored in the first array, the second number in the second array and the sum in the third array, etc.
For Example, if the arrays only contained 4 numbers and the input file looked like this:
1 2 3 4 5 6 7 8
The first array would have: 1 2 3 4
The second array would have: 5 6 7 8
The third array would have: 6 8 10 12
What is printed:
1 5 6
2 6 8
3 7 10
4 8 12