Bird
0
0

What will be the output of this code?

medium📝 Predict Output Q4 of 15
C - onditional Statements
What will be the output of this code?
int x = 7;
if (x > 5) {
printf("High");
} else {
printf("Low");
}
A7
BLow
CHigh
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Check the value of x

    x is 7, which is greater than 5.
  2. Step 2: Evaluate the if condition

    Since x > 5 is true, the if block runs and prints "High".
  3. Final Answer:

    High -> Option C
  4. Quick Check:

    Condition true = print High [OK]
Quick Trick: If condition true runs if block, else runs else block [OK]
Common Mistakes:
  • Choosing else output when condition is true
  • Confusing printed values
  • Ignoring else block

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes