COMPREHENSIVE EXAM 2026 QUESTIONS
WITH ANSWERS GRADED A+
◉ if- else branch. Answer: has two branches: The first branch is
executed IF an expression is true, ELSE the other branch is executed.
◉ Branch vs loop. Answer: branch is a one time decision while a loop
repeats
◉ equality operator. Answer: Checks whether two operands' values are
the same (==) or different(!=).
◉ 4 relational operators. Answer: <,>,>=,<=
◉ 3 logical operators. Answer: and, or, not
◉ precedence rules. Answer: (),**,*,+relational, logical
◉ infinite loop. Answer: condition never becomes false
, ◉ sentinel value. Answer: a special value to end the loop
◉ 3 parts of loop. Answer: initialize,condition, update
◉ What is an identifier? Answer: name given to variables, functions,
classes
◉ What does the modulo operator do? Answer: The modulo operator
(%) returns the remainder after one number is divided by another.
◉ What is the difference between a variable and a constant? Answer: A
variable can change its value and is used for dynamic values. A constants
value cannot be changed and is for fixed values e.g PI
◉ How does an array work? Answer: An array is a collection of ordered
values stored under a single name.Each element is accessed by its index
(position).
◉ What does index reference? Answer: An index refers to the position
of an element in an array (or list).Most programming languages (Python,
Java, C++) use 0-based indexing.
array[0] is the first element, not the second.
◉ integar. Answer: whole number