Skip to the task
Layout
Back to classic view

You are looking ahead. Your place is still task 1: About.

CHECKTask 12 of 17 · step 3: Questions 7–12Reverse the array?
Reverse the array? in practice/04/

What does it print?

Details & hint
int m[4] = {4, 3, 2, 1};
for (int x = 0; x < 4; x++) {
    m[x] = m[3 - x];
}
printf("%d %d %d %d\n", m[0], m[1], m[2], m[3]);

Stuck? 1 2 2 1: the second half reads boxes that were already overwritten. To reverse, swap pairs up to the middle. (Topic 6)

practice 04 CMakeLists.txt Code Diff
UNCHANGED This step does not change this file.
add_executable(p04_average main.c)
target_link_libraries(p04_average PRIVATE course_input)