What do you mean by: Syntax Error, Logical Error, Runtime Error?

Answer Posted / asit ranjan

Syntax error occurs when there happens to be a misuse of a
programming language's instructions.It happens at the time
of compilation.such errors need to be rectified before
proceeding further.
e.g.
1> x_y+z will cause syntax error as '_' is not an
assignment operator.
2>if(a=b) will cause syntax error as '=' is not relational
operator.

Runtime Error occurs at run-time.Such error cause a program
to end abrubtly or even cause system shut-down.Such errors
are hard to detect.
e.g. Error caused due to low system memory.

Logical Error :- It may happen that a program contains no
syntax or run-time errors but still it doesn't produce the
correct O/P.It is because the developer has not understood
the problem statement properly.These errors are hard to
detect as well.
e.g. Error caused when any loop is not closed at the right
place.

Is This Answer Correct ?    68 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is space complexity of a program?

461


What are the pre-requisite for the collection to perform binary search?

493


State the different ways of representing expressions?

697


What are the types of map?

446


How to create your own data structure in java?

501






Can arraylist be null?

475


Is linkedlist thread safe?

453


Which sorting algorithm is best for large data?

459


Where will be the free node available while inserting a new node in a linked list?

561


Is map a collection?

485


Do all declaration statements result in a fixed reservation in memory?

506


How does a binary search work?

443


What are the types of collision resolution strategies in open addressing?

571


What is a list in data structure?

456


How would you use qsort() function to sort the name stored in an array of pointers to string?

565