Computer Science, asked by jyothimanjunath84, 11 months ago

Output of Math.round(14.7)+Math.floor(7.9)

Answers

Answered by ravikantoct2004
27

22 is the right answer

Hope it helps

Answered by qwvilla
1

Question :

What will be the output of Math.round(14.7)+Math.floor(7.9)

Answer :

OUTPUT

22

  • The function Math.round() returns the nearest integer value.
  • Hence, 14.7 is rounded up to 15.
  • The function Math.floor() returns the double value rounded downwards.
  • Hence, 7.9 is rounded down to 7.
  • Math.round(14.7)+Math.floor(7.9) returns the value as 15 + 7 which is equal to 22.
  • Hence the output of the given operation will be 22.
  • The operation Math.round(14.7)+Math.floor(7.9) will return 22 as output.

#SPJ3

Similar questions