A

Admin • 833K Points
Coach

Q. What is the output of the following code snippet? int x = 5; cout << x++;

  • (A) 5
  • (B) 6
  • (C) 0
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 20
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

The post-increment operator (x++) returns the original value of x before incrementing it.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.