Computer Science, asked by zoya89, 1 year ago

definition of syntax error and run error

Answers

Answered by manojkumar1501
3

SYNTAX ERROR

A syntax error is an error in the source code of a program. Since computer programs must follow strict syntax to compile correctly, any aspects of the code that do not conform to the syntax of the programming language will produce a syntax error.

Unlike logic errors, which are errors in the flow or logic of a program, syntax errors are small grammatical mistakes, sometimes limited to a single character.

RUNTIME ERROR

A runtime error is a program error that occurs while the program is running. The term is often used in contrast to other types of program errors, such as syntax errors and compile time errors.

There are many different types of runtime errors. One example is a logic error, which produces the wrong output.

A program with a syntax error cannot be executed.

The program with a runtime error can be executed but dumps under certain conditions.

Example: You have a division statement in your program. If for some reason the denominator becomes zero then you will get a runtime error (something like DIVISION_BY_ZERO).

Syntax errors are static error that can be detected by the compiler.

Runtime errors are dynamic error that cannot be detected by the compiler.

Answered by Harshjain40274
0

In computer science, a syntax error is an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language. For compiled languages, syntax errors are detected at compile-time. A program will not compile until all syntax errors are corrected

Similar questions