Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

logic error

A mistake that lets the program run but gives the wrong result.

A logic error is a defect in what the program does rather than in its form; it compiles and runs but produces incorrect behavior.

Examples

  • double avg = (a + b) / 2; with int a and b compiles and runs, but 2 and 3 average to 2.0.

Read the full section →