Home | | Computer Science 11th std | C++ program: Types of Errors

Chapter: 11th Computer Science : Chapter 9 : Introduction to C++

C++ program: Types of Errors

Some common types of errors are given below:

Types of Errors

Some common types of errors are given below:

 

Type of Error and Description

 

Syntax Error

 • Syntax is a set of grammatical rules to construct a program. Every programming language has unique rules for constructing the sourcecode.

 • Syntax errors occur when grammatical rules of C++ are violated.

 • Example: if you type as follows, C++ will throw an error.

 cout << “Welcome to Programming in C++”

 • As per grammatical rules of C++, every executable statement should terminate with a semicolon. But, this statement does not end with a semicolon.

 

Semantic Error

• A Program has not produced expected result even though the program is grammatically correct.It may be happened by wrong use of variable / operator / order of execution etc. This means, program is grammatically correct, but it contains some logical error. So, Semantic error is also called as “Logic Error”.

 

Run-time error

 • A run time error occurs during the execution of a program. It is occurs because of some illegal operation that takes place.

 • For example, if a program tries to open a file which does not exist, it results in a run-time error


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
11th Computer Science : Chapter 9 : Introduction to C++ : C++ program: Types of Errors |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.