Skip to the task
Layout
Back to classic view

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

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

0.1 + 0.2

What does it print?

if (0.1 + 0.2 == 0.3) {
    printf("equal\n");
} else {
    printf("not equal\n");
}
Stuck?

not equal. 0.1 and 0.2 are stored only approximately. Compare doubles with a tolerance, not ==. (Topic 2)