Professional Documents
Culture Documents
Lecture#10
Lecture#10
Lecture#10
12
SUBJECT TEACHER:
RASHAD MAHMOOD
CMA (Managerial) MBA-IT & Business
Cisco Certified Network Administrator
Microsoft Certified System Engineer
Linux Operating System Certified
Comptia Computer Hardware Certified
Debugging
• Process of finding and removing
• The errors msut be removed from the program before it can be
compiled and executed
Syntax Errors
• A type of error that occurs when an invalid statement is written in the program
• Compiler detects syntax errors
• A program containing syntax errors cannot be compiled successfully
Syntax is a collection of
Causes of Syntax Erros rules for writing programs
• The statement terminator is missing at the end of statement in any language
• A misspelled keyword is used in the program
• Any of the delimiters is missing
Example
Typing forr instead of for is an example
Logical Errors
• A type of error that occurs due to poor logic of the programmer
• A statement with logical error may produce unexpected and wrong results in program
• Difficult to find because translator cannot detect
• It can only be detected by examining the program thoroughly
Example
• Using wrong conditions in program such as writing a<5 instead of a>5
• Using wrong formula as writing average=total *5 instead of average=total/5
Copyright @ Superior College Kharian RASHAD MAHMOOD ( IT SPECIALIZED)
Run Time Errors
• A type of error that occurs during the execution of program
• It occurs when a statement directs the computer to execute an illegal operation
• These are detected and displayed by the computer during execution
• Normally occur due to wrong input from the user
• Computer stops executing the program and displays error message if a run time error occurs
Example
• Dividing a number by zero
• User may enter wrong type of data
• User may ask the program to open a file does not exist
The user needs to review the whole program to find out logical error