Multiple choice

Which of the following statement correctly obtains the remainder on dividing 5.5 by 1.3?

  1. Rem = 5.5 % 1.3

  2. Rem = modf(5.5,1.3)

  3. Rem = fmod(5.5,1.3)

  4. We cannot determine the reminder while doing floating point division.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The standard modulo operator (%) in C only works with integer types. To find the remainder of a division involving floating-point numbers like 5.5 and 1.3, the fmod function from the math.h library must be used.