Machine-translated by Google. Questions are authored in English.
Top

Discussion

The expression a = 7/22 ∗ (3.14 + 2) ∗ 3/5 evaluates to

  • A.8.28
  • B.6.28
  • C.3.14
  • D.0

Answer: D

The expression evaluates to 0, option (D). In C, the operands 7 and 22 are both integers, so 7/22 is integer division and gives 0, because the fractional part is dropped. Multiplying 0 by (3.14 + 2) gives 0, and multiplying by 3 and dividing by 5 keep it at 0, so the whole expression is 0. If the division were done in floating point, the value would be about 0.98, which is not among the options. The values 8.28, 6.28 and 3.14, options (A), (B) and (C), come from treating the expression as a real number formula, which C does not do when both operands of the division are integers.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.