




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























C. String D. Character Correct answer: B Rationale: An integer stores whole-number values, making it appropriate for counting students.
Correct answer: B Rationale: Comments document code and explain its purpose. They are generally ignored by the program during execution.
Correct answer: B Rationale: Syntax errors occur when code does not follow the language's required structure.
x = 5 x = x + 3 x = x * 2 What is the final value of x? A. 10 B. 13 C. 16 D. 21 Correct answer: C Rationale: First, x becomes 8. Multiplying 8 by 2 produces
What is the result of 17 MOD 5? A. 2 B. 3 C. 5 D. 3. Correct answer: A Rationale: The modulo operation returns the remainder after division. Seventeen divided by five leaves a remainder of two.
Which operator is commonly used for integer division in languages that distinguish it from ordinary division? A. + B. // C. == D. &&
score = 72 IF score >= 60 DISPLAY "Pass" ELSE DISPLAY "Fail" What is displayed? A. Fail B. Pass C. 60 D. Nothing Correct answer: B Rationale: Since 72 is greater than or equal to 60, the condition is true and "Pass" is displayed.
C. A do-while loop cannot contain conditional logic D. A while loop cannot execute more than once Correct answer: B Rationale: A do-while loop evaluates its condition after the body, guaranteeing at least one execution.
A. Attempting to access an array position that does not exist B. Attempting to add two integers C. Declaring a variable without a comment D. Printing an array element successfully Correct answer: A Rationale: An out-of-bounds error occurs when a program accesses an index outside the array's valid range.
C. A Boolean operator D. A type of loop Correct answer: A Rationale: Strings represent text as sequences of characters, including letters, digits, spaces, and symbols.
Correct answer: B Rationale: The function receives 4 and 6, adds them, and returns 10.
B. A variable that exists only inside a loop C. A variable that stores only whole numbers D. A variable that cannot be modified Correct answer: A Rationale: A global variable is declared in a scope that allows it to be accessed by multiple program components, subject to language rules.