Q5
What is the result of the expression 8 / 3 in C?
A.
2
AnswerB.
2.67
C.
3
D.
3.5
Answer: Option A
Solution
Answer: Option A
Solution:
In C, when you perform integer division, as in the expression 8 / 3, it results in the quotient without any decimal places. Therefore, the result is 2.Option B (2.67) is incorrect as it would be the result of floating-point division.
Option C (3) is incorrect because it would be the result of rounding up in floating-point division.
Option D (3.5) is incorrect because it would be the result of floating-point division.