What does Console.WriteLine(7 / 2); print in C#?
Correct answer B. 3
When both operands are integers, the / operator performs integer division and discards the remainder, truncating towards zero. So 7 / 2 is 3. To get 3.5, at least one operand must be a floating-point or decimal value, for example 7 / 2.0 or (double)7 / 2. This is a common source of bugs when computing averages.
Answer checked How we write and check questions
Discussion