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
7
Answer: rem = fmod (3.14, 2.1);
Explanation:
Answered by
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
English,
7 months ago
Social Sciences,
7 months ago
English,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago