CSE 1321 TEST PAPER 2026/2027 QUESTIONS AND
SOLUTIONS RATED A+
✔✔The ------- provides another way to decide which statement to execute next -
✔✔switch statement
✔✔The switch statement evaluates an --------, then attempts to match the result to one
of several possible - ✔✔expression, cases (cases)
-Each case contains a value and a list of statements
-The flow of control transfers to statement associated with the first case value that
matches
✔✔Often a ------ is used as the last statement in each case's statement list - ✔✔break
statement
✔✔A break statement causes control to transfer to the - ✔✔end of the switch statement.
-If a break statement is not used, the flow of control will continue into the next case
✔✔Default Case - ✔✔-A switch statement can have an optional default case
-The default case has no associated value and simply uses the reserved word default
-If the default case is present, control will transfer to the default case if no other case
value matches
-If there is no default case, and no other value matches, control falls through to the
statement after the switch statement
✔✔The expression of a switch statement cannot - ✔✔-It cannot be a boolean value or a
floating-point value (float or double)
-You cannot perform relational checks with a switch statement
✔✔The expression of a switch statement must result in - ✔✔an integer type (byte, short,
int, long) or a char type.
✔✔ are just notes that explain the program to yourself and others. - ✔✔Comments
✔✔is just a name you give a variable - ✔✔An identifier
✔✔Spaces, blank lines, and tabs are called - ✔✔white space;
Used to separate words and symbols in a program. Extra white space is ignored
✔✔Printing an -------- prints a special character in an output string. - ✔✔escape
sequence
✔✔\b - ✔✔is backspace. (e.g "B\bsecz\bret" prints what?) (escape sequence)
SOLUTIONS RATED A+
✔✔The ------- provides another way to decide which statement to execute next -
✔✔switch statement
✔✔The switch statement evaluates an --------, then attempts to match the result to one
of several possible - ✔✔expression, cases (cases)
-Each case contains a value and a list of statements
-The flow of control transfers to statement associated with the first case value that
matches
✔✔Often a ------ is used as the last statement in each case's statement list - ✔✔break
statement
✔✔A break statement causes control to transfer to the - ✔✔end of the switch statement.
-If a break statement is not used, the flow of control will continue into the next case
✔✔Default Case - ✔✔-A switch statement can have an optional default case
-The default case has no associated value and simply uses the reserved word default
-If the default case is present, control will transfer to the default case if no other case
value matches
-If there is no default case, and no other value matches, control falls through to the
statement after the switch statement
✔✔The expression of a switch statement cannot - ✔✔-It cannot be a boolean value or a
floating-point value (float or double)
-You cannot perform relational checks with a switch statement
✔✔The expression of a switch statement must result in - ✔✔an integer type (byte, short,
int, long) or a char type.
✔✔ are just notes that explain the program to yourself and others. - ✔✔Comments
✔✔is just a name you give a variable - ✔✔An identifier
✔✔Spaces, blank lines, and tabs are called - ✔✔white space;
Used to separate words and symbols in a program. Extra white space is ignored
✔✔Printing an -------- prints a special character in an output string. - ✔✔escape
sequence
✔✔\b - ✔✔is backspace. (e.g "B\bsecz\bret" prints what?) (escape sequence)