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/03/

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 03 CMakeLists.txt Code Diff
UNCHANGED This step does not change this file.
add_executable(p03_grades main.c)
target_link_libraries(p03_grades PRIVATE course_input)