Bird
0
0

Which of these conditions will make the if statement run its block?

easy📝 Conceptual Q2 of 15
C - onditional Statements
Which of these conditions will make the if statement run its block?
int a = 10;
if (___) {
printf("Run");
}
Aa < 5
Ba == 10
Ca > 20
Da != 10
Step-by-Step Solution
Solution:
  1. Step 1: Check the value of a

    a is assigned 10.
  2. Step 2: Evaluate each condition

    a == 10 is true, so the if block runs only for this condition.
  3. Final Answer:

    a == 10 -> Option B
  4. Quick Check:

    Condition true = run block [OK]
Quick Trick: If condition matches variable value, block runs [OK]
Common Mistakes:
  • Choosing conditions that are false
  • Confusing == with =
  • Ignoring variable value

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes