Important MCQ

Output? int x = 5; if (x = 10) cout << x;

Q.Output? int x = 5; if (x = 10) cout << x;

A) 5
B) 10
C) 1
D) Nothing
Correct Answer:
Option B
Detailed Explanation:
Assignment gives 10 (non-zero = true), x becomes 10.