Computer Science, asked by Banavathharsha7144, 1 year ago

Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
rem = 3.14 % 2.1
rem = modf(3.14, 2.1);
rem = fmod(3.14, 2.1);
Remainder cannot be obtain in floating point division.

Answers

Answered by Dishahaha
7

Answer: rem = fmod (3.14, 2.1);

Explanation:

Answered by SaurabhJacob
2

Third statement 'rem = fmod(3.14,2.1);' should be used to obtain remainder.

Since fmod() works the same as the modulo function in every language. It returns the remainder by dividing the number.

  • The First statement works with the programming languages like Python only.
  • The Second statement returns the whole number of the quotient by dividing the number.
  • The Fourth statement is also true for some programming languages.
Similar questions