What does a Boolean expression produce in C++?
A Boolean expression produces a result interpreted as either true or false. C++ contextually converts conditions to bool.
Study 03 Conditional Control Structures with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What does a Boolean expression produce in C++?
A Boolean expression produces a result interpreted as either true or false. C++ contextually converts conditions to bool.
Which operator tests equality in C++?
Use == to compare values. A single = assigns a value, so it should not replace == in an equality test.
What is short-circuit evaluation?
For A && B, C++ skips B when A is false. For A || B, it skips B when A is true.
What do &&, ||, and ! mean?
Use && when both conditions must be true; use || when at least one condition must be true; use ! to invert a Boolean value.
When does an if body execute?
An if statement executes its controlled statement or block only when its condition is true.
When does an else clause execute?
The else clause runs when the associated if condition is false.
Which if does an else belong to?
An else belongs to the nearest preceding unmatched if in the same statement structure. Braces make the intended association explicit.
How does an else-if chain choose a branch?
An else-if chain checks conditions in order, executes the block for the first true condition, and skips all later branches.
What is a nested condition?
Nesting places one conditional statement inside another. It is useful when a second decision should occur only after a first requirement succeeds.
When is switch appropriate?
A switch compares one expression with several constant case values, usually using an integral or enumeration value.
What does break do in a switch?
A break exits the switch. Without it, execution continues into the next case; this is called fallthrough.
Why might several case labels share one block?
Intentional fallthrough lets multiple case values share one action, such as cases 6, 7, and 8 sharing a summer branch.
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
Learn how Boolean expressions, logical operators, and conditional structures let programs make reliable decisions, including how to handle boundaries, branch order, and testing.
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
A practical guide to integrating problem definition, data representation, modular programming, algorithms, complexity analysis, testing, correctness, and ethical evaluation into a responsible computer science capstone.
Reviews how interrupts support event handling and multitasking, and how Linux system calls use the RISC-V `ecall` instruction and register conventions.
This quiz covers process management, context switching and scheduling, multitasking, traps and interrupts, and RISC-V privilege transitions.
A quiz on operating-system system calls, including privileged-operation requests, process creation and execution with fork, exec, and waitpid, and signal handling.