Computer Science, asked by snehal1525, 7 months ago

give the output
float x=-7.87;

system.out.println(math.ceil(x));
system.out.println(math.floor(x));

Answers

Answered by anant5056
9

Explanation:

  1. -7
  2. -8

HOPE IT HELPS

MARK ME AS BRAINLIEST.

Answered by EthicalElite
31

\huge\tt{Question:-}

Give the output

float x=-7.87;

system.out.println(math.ceil(x));

system.out.println(math.floor(x));

\huge\tt{Procedure:-}

◕ Math.ceil(x)

= math.ceil(-7.87)

= -7.0

◕ Math.floor(x)

= math.floor(-7.87)

= -8.0

\huge\tt{Output:-}

-7.0

-8.0

_______________________________

Note:-

  • Math.ceil() is used to return the higher integer for the given argument.
  • Math.floor() is used to return the lower integer for the given argument.

________________________________

Similar questions