Question 8
Back to Exercise
Which expression gives the remainder after dividing 3.14 by 2.1?
- A 3.14 % 2.1
- B fmod(3.14, 2.1) Correct
- C mod(3.14, 2.1)
- D rem(3.14, 2.1)
Correct Answer: Option B
% is only defined for integers. fmod() from <math.h> returns the floating-point remainder: 1.04.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!