Q. What is the output of the following code in C++?

int a = 10;
int b = 3;
cout << a % b;

  • (A) 3
  • (B) 1
  • (C) 10
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1
Explanation: The '%' operator returns the remainder of the division. So, 10 % 3 = 1.
Explanation by: Vinay
The '%' operator returns the remainder of the division. So, 10 % 3 = 1.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
202
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
95%
Success Rate