COMPUTER PROGRAMMING FUNDAMENTALS
PROGRAMMING LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
pounds = pence x 100
|
|
pounds = pence * 100
|
|
pounds = pence / 100
|
|
pounds = 100 / pence
|
Detailed explanation-1: -A syntax error occurs when a programmer writes an incorrect line of code. Most syntax errors involve missing punctuation or a misspelled name. If there is a syntax error in a compiled or interpreted programming language, then the code won’t work.
Detailed explanation-2: -Syntax errors are mistakes in using the language. Examples of syntax errors are missing a comma or a quotation mark, or misspelling a word.
Detailed explanation-3: -Type errors (such as an attempt to apply the ++ increment operator to a boolean variable in Java) and undeclared variable errors are sometimes considered to be syntax errors when they are detected at compile-time. However, it is common to classify such errors as (static) semantic errors instead.
Detailed explanation-4: -Logic errors occur when there is a fault in the logic or structure of the problem. Logic errors do not usually cause a program to crash. However, logic errors can cause a program to produce unexpected results.