Q. What will be the output?

Code:
int x = 5;
System.out.println(x++ + ++x);
  • (A) 11
  • (B) 12
  • (C) 13
  • (D) 10
πŸ’¬ Discuss
βœ… Correct Answer: (B) 12
Explanation: x++ gives 5 then x becomes 6, ++x makes it 7, so 5 + 7 = 12.
Explanation by: Roshan
x++ gives 5 then x becomes 6, ++x makes it 7, so 5 + 7 = 12.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
20
Total Visits
πŸ“½οΈ
4 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
86%
Success Rate