All mock tests are FREE till 31 December — register to save your progress

Of the following, which is NOT a logical error?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. Using commas instead of the two required semicolons in a for loop header

Explanation

Using commas instead of the two semicolons in a for header is a syntax error caught by the compiler, so it is not a logical error. Using = instead of ==, forgetting to initialize counters and dividing by zero are mistakes in the program's logic.

More Programming Languages and Computer Graphics questions