1.

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

Answer»

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<<a; // instead of extraction operator insertion operator is used.

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.



Discussion

No Comment Found