Quiz Programming, Data Types,
Control Structures Questions with
100% Correct Answers
What is a Form-level variable? - Answer- A variable declared at the form scope rather
than locally inside a specific event.
Why is it necessary to use Form-level variables instead of local variables? - Answer-
They are required to persist data and remember 'states' across multiple, separate
button clicks.
What characters are used to begin a single-line comment in C#? - Answer- //
What is the technique of joining strings together called? - Answer- Concatenation
What operator is used to concatenate strings in C#? - Answer- +
How do you assign an empty string to clear a text box or label? - Answer- ""
What is the purpose of the \" syntax inside a string? - Answer- It allows you to place
quotation marks within the string output.
What is the order of precedence for evaluating logical operators in a complex
expression? - Answer- NOT is first, AND is second, OR is third.
In an IF-statement, what block of code executes as a catch-all if the original condition is
false? - Answer- The else block.
What decision structure is generally cleaner than nested IF statements for comparing a
single expression against many specific values? - Answer- A switch statement.
What keyword is required to exit a specific case block inside a switch statement? -
Answer- break.
Inside a switch statement, what keyword catches all values that are not explicitly
defined in the cases? - Answer- default.