Execution-Time Errors
In this lesson, we will focus on finding logical errors in a program.
We'll cover the following...
We'll cover the following...
An error in the logic of a program usually goes undetected by the compiler. Rather, such errors cause problems during the program’s execution. As we indicated in the previous lesson of this debugging interlude, a logical error might or might not cause an error message during execution.
Incorrect arithmetic
The program in the previous lesson had a syntax error. The following program corrects that error by inserting the * operator between 2 and y in the computation of z. Execute this program by clicking the RUN button.