Question:
give definition *** meaning of these terms exactly?
kiran
2008-02-14 02:36:39 UTC
syntax error
logical error
runtime error
Seven answers:
Horizon
2008-02-14 02:57:13 UTC
syntax error: Its an error where you have typed something wrong.

Eg a wrong name for a function prntf() instead of printf() or forgot to put a semicolon at the end of a line.



logical error: It an error where you programmed something different than you were supposed to do.

Eg. you had to do x*y but you did x+y. So if x=2 and y=2 then 2 * 2 = 4. But you did 2+2= 4 and hence its correct but logic is wrong.

Another example will be say you were supposed to add services to total bill, but you put - instead of +. So that is a logical error again.



runtime error: Its something which happens at runtime and you get an error message.



Eg. Say you tried multiply two big numbers which the data-type cannot handle or an array overflow.
abhinav.nishant
2008-02-14 03:11:45 UTC
Syntax Error: It comes up when u use wrong commands or statements..just like if u typed it wrong or a mistake in the statements.

for example as in c/c++

prinf() instead of printf()...see the "t" missing or

for(x ; y , x) instead of for(x ; y ; z)...see the colon missing



Logical error: It is hard to fine as it doesnot appears in the error list. Just for example u typed "x+y" instead of "x-y". The result will change but the program works fine.



Runtime error: It creeps when there is some address voilation or overflow. Consider a statement "x / y"

in the mean time the program runs, "x" gets the value of any integer, just in case say "5" and y gets a value of "0", then this will lead to an arithmetical error and show runtime error.

The program is absolutyely fine but some case makes the value of "y"=0 which creates the runtime error.
2008-02-14 03:14:14 UTC
Syntax error: Its an error where you have typed something wrong.

Eg a wrong name for a function prntf() instead of printf() or forgot to put a semicolon at the end of a line.



logical error: It an error where you programmed something different than you were supposed to do.in logical error computer don't shows u the error but u doesn't get desired result



runtime error: Its something which happens at runtime and you get an error message.



Eg. when u start a loop but doedn't supply the appropriate limit of the loop then it goes into infinite loop.Then such type of error is called run-time error.
madhavkodakalla
2008-02-15 03:09:39 UTC
Syntax error: this is an error in which the keyword entered is not recognized by the compiler or interpreter

Logical error: this is an error in which it might not display the exact result as per the requirement. one should look into it very carefully to get it corrected.

Runtime error: this is an error in which the program stops running as it encountered an exception(such as Zero divide i.e dividing any number with Zero).
Kaavy querido!!
2008-02-14 02:41:56 UTC
An error that occurs when a program cannot understand the command that has been entered-Syntax error

An error that occurs when a program cannot understand the command that has been entered-Logical error

An {error} in the execution of a program which occurs at {run time}, as opposed to a {compile-time error}.-Runtime error

=)
veejay
2008-02-14 10:38:09 UTC
SYNTAX error-the way or code of the program is not used in the right way.one or two attributes or a format s missed or changed or wrong.



LOGICAL error-makes the program not to arrive at an end.like an infinite loop

RUNTIME error-Errors caused when program is executed.(eg-one data type i/p is given in the place of another like text in a integer input)
abbumiya
2008-02-14 02:56:07 UTC
When u approach Ms.ABC instead of Ms. XYZ - it is Syntax Error.

When u ask Mr. AABBCC about dating instead of Ms. XYZ - it is logical error.

When u urinate in your trousers after u get slapped by Ms. ABC, it is runtime error.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...