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;withinta and b compiles and runs, but2and3average to2.0.
See also