1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is a piece of data that represents true/false called?
Logical
In C, which value is considered false?
0
What does the expression 5 && -3 evaluate to?
1
When is the operator || true?
At least one operand is true
Which operator has higher precedence, || or &&?
&&
What is the complement of x > 5?
x <= 5
Which is TRUE about an if statement?
Condition must be in parentheses
What is the result of: 3 || 6 && 0?
1
Which correctly represents a complement of a == 0?
Both !a and a != 0
How is the "dangling else" problem fixed?
Curly braces {}
How many operands does the ternary operator have?
3 operands
What does 6 % 2 || 7 % 2 evaluate to?
1
What does 3 == 3 && -1 && 1 evaluate to?
1
What is !(x < 10) equivalent to?
x >= 10
Which is equivalent to x % 2 (for non-negative x)?
x % 2 != 0
What must the switch expression be?
Integral
What happens if a break is missing in a case?
Fall-through occurs
Which is TRUE about case labels?
Must be constant expressions
What does the break statement do?
Exits switch
Negative logic typically involves?
!
What is best practice for placing conditions?
Most likely conditions first
When does a pretest loop check the condition?
Before loop
How many times does a post-test loop execute at least?
1 time
What is an iteration?
One execution of loop body
What do event-controlled loops do?
Run until condition changes
How many times is a pretest condition evaluated for n iterations?
n + 1
What does while loop syntax require?
Parentheses
What does do-while end with?
;
What is input validation?
Event-controlled
Why is selection alone insufficient for validation?
Limited attempts
What does short-circuit evaluation apply to?
Both if and loops
Which is typically prohibited by course standards?
break/continue for loop control