Skip to the task
Layout
Back to classic view

You are looking at: Practice test 1. Your place is still lesson 3, task 1: Conditions.

CHECKTask 7 of 17 · step 2: Questions 1–6

Why doesn't it build?

Why doesn't this code build with the course flags?

int x = read_int("x: ");
if (x = 5) {
    printf("five\n");
}
Stuck?

x = 5 is an assignment. GCC: suggest parentheses around assignment used as truth value, and -Werror makes it an error. It must be x == 5. (Topic 3)