Write a loop that traverses the array arr from 0 to less than the length of the array. In the loop, double each element in the array arr and print out each new value on the same line separated by β, β. The finished code should print β2, 4, 6, 8, 10, β.
Write a for loop that fills an array with elements that count up from 0 to 50 by 5 (0 5 10 15 20 β¦ 50) and prints out each element on a separate line.
Finish the method to return a new array of length 2 containing the middle two elements of a given array of integers of even length (the parameter) β so {1,2,3,4} should return {2,3}.