V

Vikash Gupta • 33.56K Points
Instructor I

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

int x = 10;
int y = 5;
cout << x / y;

  • (A) 5
  • (B) 2
  • (C) 10
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 43
  • Filed under category C++

Explanation by: Vikash Gupta
In integer division, the result is the quotient of the division. So, 10 / 5 equals 2.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics