Swap the first with the last, then move inward, until the middle.
Reversing in place means the same array turns around: first swaps with last, then you step inward, until you meet in the middle. No second array required.
start
4 2 3 1
4 3 2 1
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. 1 2 3 4 reversed is:
Swap 0↔3 then 1↔2.
2. Why stop at n/2?
Do not swap twice.
3. t holds:
Classic three-step swap.
4. In-place means:
No extra n boxes.
5. Strings reverse until:
Do not reverse the 0 byte into the middle.