Chapter 6 Engdebugging Programs
Chapter 6 Engdebugging Programs
By-
Neha Tyagi
PGT CS
KV 5 Jaipur II Shift
Jaipur Region
• Logical Error
Neha Tyagi, KV 5 Jaipur II Shift
Compile Time Error
• These errors are basically of 2 types –
• Syntax Error : Violation of formal rules of a programming
language results in syntax error.
For ex-
x=(x*y)
• Semantics Error: Semantics refers to the set of rules which sets the
meaning of statements. A meaningless statement results in semantics
error.
For ex-
x*y=z
Neha Tyagi, KV 5 Jaipur II Shift
Logical Error
• If a program is not showing any compile time error or run time
error but not producing desired output, it may be possible that
program is having a logical error. This error generates
because of wrong analysis by programmer.
For ex-
• To use a variable without an initial value.
OUTPUT
corrected
code
• Now, click on STEP button. All statements will be executed one by one and result
will be display in output. When we will get wrong value, we can stop the program
there and can correct the code. This process will be continued until program results
in correct desired output.
Neha Tyagi, KV 5 Jaipur II Shift
Thank you
Please follow us on our blog-
www.pythontrends.wordpress.com