Important MCQ

if (x > 5 && x < 10) is true for x =

Q.if (x > 5 && x < 10) is true for x =

A) 12
B) 7
C) 10
D) 5
Correct Answer:
Option B
Detailed Explanation:
B) 7 is correct. An if statement executes its body only when its condition is true. The condition is written in parentheses, and braces group multiple statements.