FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

PROGRAMMING LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of these pseudocode statements contains a syntax error?
A
pounds = pence x 100
B
pounds = pence * 100
C
pounds = pence / 100
D
pounds = 100 / pence
Explanation: 

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.

There is 1 question to complete.