Q. What will be the output of the following code?

int x = 5;
int y = 2;
cout << x % y;

  • (A) 3
  • (B) 2
  • (C) 1
  • (D) 5
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1
Explanation: The '%' operator calculates the remainder of a division. So, 5 % 2 = 1.
Explanation by: Vijay Sangwan
The '%' operator calculates the remainder of a division. So, 5 % 2 = 1.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
163
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vijay Sangwan
Publisher
πŸ“ˆ
88%
Success Rate