πŸ“Š C++
Q. What is the output of the following code snippet? int x = 5; int y = x++; cout << y;
  • (A) 5
  • (B) 6
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5

Explanation: The post-increment operator (x++) assigns the original value of x to y before incrementing x.

Explanation by: Gopal Sharma
The post-increment operator (x++) assigns the original value of x to y before incrementing x.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
187
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Gopal Sharma
Publisher
πŸ“ˆ
82%
Success Rate