C++ Operators and Control Structures

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards summarizing key C++ operators, conditional statements, and repetitive structures covered in the lecture notes.

informatica

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

Increment Operator (++)

Unary operator that increases an operand’s value by 1.

2
New cards

Decrement Operator (--)

Unary operator that decreases an operand’s value by 1.

3
New cards

Post-Increment (x++)

Returns the original value of x, then increases x by 1.

4
New cards

Post-Decrement (x--)

Returns the original value of x, then decreases x by 1.

5
New cards

Pre-Increment (++x)

Increases x by 1 first, then returns the new value.

6
New cards

Pre-Decrement (--x)

Decreases x by 1 first, then returns the new value.

7
New cards

Conditional Operator (?:)

Ternary operator that selects one of two expressions: expr1 ? expr2 : expr3 acts like if(expr1) expr2; else expr3.

8
New cards

Explicit Type Cast (type)expr

Forces conversion of expr to a specified data type, e.g., (double)x or (char)(p-32).

9
New cards

if Statement

Executes a block when a condition is true; can be paired with else for the false path.

10
New cards

switch Statement

Selects and executes code blocks based on the value of an integral expression.

11
New cards

case Label

Constant integral value inside a switch that marks the start of a code block to execute when matched.

12
New cards

default Label

Optional block in a switch executed when no case value matches.

13
New cards

break Statement (in switch)

Exits the switch, preventing fall-through to subsequent cases.

14
New cards

Fall-Through (missing break)

Behavior where execution continues into the next case until a break is reached.

15
New cards

for Loop

Counter-controlled loop used when the number of iterations is known.

16
New cards

while Loop

Condition-controlled loop that tests the condition before each iteration.

17
New cards

do-while Loop

Condition-controlled loop that tests the condition after executing the loop body at least once.

18
New cards

break Statement (in loops)

Immediately terminates the nearest enclosing loop or switch.

19
New cards

continue Statement

Skips the remaining loop body and starts the next iteration.