What is run-time error, logical error and syntax error?

5 views

1 Answers

Syntax error: The errors which are traced by the compiler during compilation, due to wrong grammar for the language used in the program, are called syntax errors.

For example, cin<

Runtime Error: The errors encountered during execution of the program, due to unexpected input or output are called run-time error.

For example – a=n/0; // division by zero

Logical Error: These errors are encountered when the program does not give the desired output, due to a wrong logic of the program. 

For example : remainder = a+b// instead of using % operator + operator is used.

5 views