How to fill an array with elements from another array of different size? (leaving non existent indexes as zero)

SCENARIO 1: if main array length is < 8 Declaration: int[] mainArray = new int[] { 1, 2, 3, 4, 5 } // no minimum number of elements int[] arrayOne = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; // must …