Lesson 71: Introduction to Programming

Program Errors and Correction

  • Syntax error: a place in a program where the syntax rules of the programming language were not followed. A syntax error will stop a program’s compilation or interpretation.
  • Semantic error: a situation where the programmer misunderstood the meaning of something in the programming language. Compilation and interpretation do not detect semantic errors — they are detected from wrong results, and are also called logical errors. Something may be syntactically correct but semantically incorrect.
  • Run-time error: an error that occurs when a program is being executed, for example dividing by zero. A run-time error may cause the program to stop execution.
  • Debugging: an error in a computer program is known as a bug, and debugging is the process of finding and removing bugs. Syntax errors and semantic errors are both bugs. A debugger is the software tool (or person) used for this purpose.

Key Words and Operators

A key word (or reserved word) is a predefined word in a programming language that has a specific meaning and cannot be used for any other purpose, e.g. If, Else, For, To and goto.

Operators are used to perform operations on data. They may be arithmetic (+, -, *, %, ++, –, /), relational (<, >, ==, <=, >=, !=), or logical (NOT (!), AND (&&), OR (||)).

Leave a comment

Your email address will not be published. Required fields are marked *

sponsors Ads