CSE 1321 CORE EXAMS SET 2026/2027 QUESTIONS AND
SOLUTIONS RATED A+
✔✔If the variable isTested is a Boolean, then the statement below is a valid control
expression:
IF(isTested)
true or false - ✔✔true
✔✔In programming && is considered an arithmetic operator.
true or false - ✔✔false
✔✔If x = 3, y = 1, and z = 5 then the following Boolean expression evaluates to true:
( x > 0) && (y == 0) || (z < 5)
true or false - ✔✔false
✔✔The Boolean expression ((A AND B) AND (NOT(A AND B)) evaluates to:
a) true whenever both A is true and B is true.
b) false in all cases.
c) true whenever only A is true or only B is true.
d) true in all cases. - ✔✔b) false in all cases.
✔✔Which statement below will be true after the following code terminates?
BEGIN MAIN
CREATE x = 0
WHILE (x < 100)
{
x *= 2;
}
END WHILE
END MAIN
a) x == 98
b) x == 2
c) The loop won't terminate. It's an infinite loop.
d) x == 0 - ✔✔c) The loop won't terminate. It's an infinite loop.
(0 * 2 will always be 0 so infinite loop)
, ✔✔Consider this code:
BEGIN MAIN
int y=1;
int x=1;
PRINTLINE(x++);
END MAIN
What will this code print?
a) 2
b) 0
c) 1
d) unknown - ✔✔c) 1
✔✔A relational operator used when comparing primitive data types is !=.
true or false - ✔✔true
✔✔A switch statement is similar to an if statement in that both are used to alter the flow
of a program.
true or false - ✔✔true
✔✔Pseudocode form of writing should be used only when the logic of the program is
complex.
true or false - ✔✔false
✔✔Is this valid syntax for a FOR loop?
BEGIN MAIN
FOR(CREATE j = 0; j < 1000; j++) PRINT(j) END FOR
END MAIN
True or False - ✔✔true
✔✔Mathematical Operators are: - ✔✔Addition: +
subtraction: -
Multiplication: *
Divison: /
Modulus (remainder): %
✔✔Comparison/Relational Operators are: - ✔✔"==" equals to
"!=" not equals to
SOLUTIONS RATED A+
✔✔If the variable isTested is a Boolean, then the statement below is a valid control
expression:
IF(isTested)
true or false - ✔✔true
✔✔In programming && is considered an arithmetic operator.
true or false - ✔✔false
✔✔If x = 3, y = 1, and z = 5 then the following Boolean expression evaluates to true:
( x > 0) && (y == 0) || (z < 5)
true or false - ✔✔false
✔✔The Boolean expression ((A AND B) AND (NOT(A AND B)) evaluates to:
a) true whenever both A is true and B is true.
b) false in all cases.
c) true whenever only A is true or only B is true.
d) true in all cases. - ✔✔b) false in all cases.
✔✔Which statement below will be true after the following code terminates?
BEGIN MAIN
CREATE x = 0
WHILE (x < 100)
{
x *= 2;
}
END WHILE
END MAIN
a) x == 98
b) x == 2
c) The loop won't terminate. It's an infinite loop.
d) x == 0 - ✔✔c) The loop won't terminate. It's an infinite loop.
(0 * 2 will always be 0 so infinite loop)
, ✔✔Consider this code:
BEGIN MAIN
int y=1;
int x=1;
PRINTLINE(x++);
END MAIN
What will this code print?
a) 2
b) 0
c) 1
d) unknown - ✔✔c) 1
✔✔A relational operator used when comparing primitive data types is !=.
true or false - ✔✔true
✔✔A switch statement is similar to an if statement in that both are used to alter the flow
of a program.
true or false - ✔✔true
✔✔Pseudocode form of writing should be used only when the logic of the program is
complex.
true or false - ✔✔false
✔✔Is this valid syntax for a FOR loop?
BEGIN MAIN
FOR(CREATE j = 0; j < 1000; j++) PRINT(j) END FOR
END MAIN
True or False - ✔✔true
✔✔Mathematical Operators are: - ✔✔Addition: +
subtraction: -
Multiplication: *
Divison: /
Modulus (remainder): %
✔✔Comparison/Relational Operators are: - ✔✔"==" equals to
"!=" not equals to