5 AnswersNew Answer
Where is your attempt?
i dont know how to do this, this is a task from university. i study remotely...
Saying you have 4 numbers for each row. You start the loop with index = 0, so you can access the 1st element of a row with arr[row][index]. What's the mirror of it? arr[row], because it's the last element. arr[row] <-> arr[row] arr[row] <-> arr[row] You see the pattern? When index is increased by 1, the mirror of it i decreased by 1. When index is increased by N, the mirror of it is decreased by N. Let K be "the length of last element - 1". You can swap arr[row][index] with arr[row][K - index], while iterating the array to half with for(int index = 0 ; index <= K/2 ; index++)
can you write full program? please)
I didn't complete the code. You need to complete it yourself. https://code.sololearn.com/cm0jLLGu0gJ2/?ref=app