A

Admin • 802.91K Points
Coach

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
  • Correct Answer - Option(C)
  • Views: 3
  • Filed under category C++
  • Hashtags:

Explanation by: Admin
The '%' operator calculates the remainder of a division. So, 5 % 2 = 1.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.