Print the sum of corresponding elements in two arrays
You don't need to store the intermediate result.
You don't need to give the length of the arrays.
This assumes that the arrays are allways of equal length.

for(int i = 0; i &lt; firstArray.length; i++){
    System.out.print((firstArray[i] + secondArray[i]) + " ");
}