Switch the array places in a loop

Hi. It’s simpler than you think!
You need to step through c in increments of 2. This means a single for loop:
for (int i = 0; i < c.length; i+=2)
then in this loop assign a[i/2] to c[i] and then b[i/2] to c[i+1]
Done!

1 Like