COMPUTER PROGRAMMING FUNDAMENTALS
PROGRAMMING LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
FOR x=0 TO 10 STEP-1
|
|
FOR x=0 TO 10 STEP 1
|
|
FOR x=10 TO 0 STEP-1
|
|
FOR x=0 TOO 10 STEP 1
|
Detailed explanation-1: -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.
Detailed explanation-2: -A logical error is a mistake in reasoning by the programmer, but it is not a mistake in the programming language. An example of a logical error would be dividing by 2.54 instead of multiplying to convert inches to centimeters.
Detailed explanation-3: -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-4: -What is a syntax error? A6. We can define these types of errors basically as grammatical errors. Each programming language has its own set of rules and ways of writing the program, if the programmer violates any of these rules this is the syntax error.