What does a C++ type determine?
A type determines which values an object or expression can represent and which operations are valid.
Study 02 Variables, Types, and Operators with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What does a C++ type determine?
A type determines which values an object or expression can represent and which operations are valid.
What is the typical difference between `int` and `double`?
`int` represents whole numbers, while `double` represents floating-point numbers with fractional parts.
Why initialize a local variable before reading it?
A variable should be initialized before it is read; an uninitialized local built-in variable does not have a useful automatic value.
What safety benefit does brace initialization provide?
Brace initialization rejects many narrowing conversions, such as assigning `3.14` to an `int`.
What restriction does `const` place on a variable?
A `const` variable cannot be modified after initialization and must be initialized when declared.
How does `constexpr` differ from `const`?
Every `constexpr` variable is constant and is intended for constant expressions; a `const` variable is not necessarily a compile-time constant.
What is a name's scope?
Scope is the region of a program in which a name can be used.
What happens when an inner name shadows an outer name?
An inner declaration with the same spelling hides the declaration from the outer scope within the inner region.
Which cast makes an intentional numeric conversion explicit?
`static_cast` is the preferred general-purpose C++ cast for a well-understood numeric conversion.
How does integer division differ from floating-point division?
For integer operands, division discards the fractional part: `7 / 2` produces `3`, while `7.0 / 2` produces `3.5`.
How do prefix and postfix increment differ?
For `++x`, the variable is incremented before the expression's value is used; for `x++`, its old value is used first.
What is the difference between `==` and `=`?
`==` compares two values for equality, whereas `=` assigns a value to an existing modifiable object.
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.