Q. What is the result of the following expression in C++: '5 / 2'?

  • (A) 2.5
  • (B) 2
  • (C) 3
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 2
Explanation: In integer division, the fractional part is discarded, so the result of 5 / 2 is 2.
Explanation by: Ram Sharma
In integer division, the fractional part is discarded, so the result of 5 / 2 is 2.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
226
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
94%
Success Rate