Skip to the task
Layout
Back to classic view

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

CHECKTask 11 of 17 · step 3: Questions 7–12assert and input
assert and input in practice/05/

What is wrong?

Details & hint
int age = read_int("Age: ");
assert(age >= 0);

Stuck? assert checks the programmer's mistakes, not input: in Release (NDEBUG) it disappears. Check input with a while loop. (Topic 5)

practice 05 CMakeLists.txt Code Diff
UNCHANGED This step does not change this file.
add_executable(p05_grades main.c)
target_link_libraries(p05_grades PRIVATE course_input)
add_executable(p05_recursion recursion.c)