πŸ“Š C++
Q. What will be the output of the following code?

int a = 5;
cout << ++a;
  • (A) 5
  • (B) 6
  • (C) Error
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) 6

Explanation: The '++a' is a pre-increment operator, which increments the value of 'a' before it is used, so the output is 6.

Explanation by: Vijay Sangwan
The '++a' is a pre-increment operator, which increments the value of 'a' before it is used, so the output is 6.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
153
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vijay Sangwan
Publisher
πŸ“ˆ
87%
Success Rate