Computer Science, asked by ronaknair418, 6 hours ago

Write the output of the following ceil and floor methods:
a) double x = Math.ceil(5.9); b) double x = Math.ceil(5.2);
c) double y = Math.ceil(-5.9); d) double a = Math.ceil(-5.2);
e) double x = Math.ceil (O);
f) double x = Math.floor(5.9);
g) double a = Math.floor (-5.2); h) double x = Math.floor( -5.9);
i) double z = Math.floor(0);
j) double s = Math.floor( 9.0);​

Answers

Answered by vaibhavkumar3004
1

Answer:

Write the output of the following ceil and floor methods:

a) double x = Math.ceil(5.9); b) double x = Math.ceil(5.2);

c) double y = Math.ceil(-5.9); d) double a = Math.ceil(-5.2);

e) double x = Math.ceil (O);

f) double x = Math.floor(5.9);

g) double a = Math.floor (-5.2); h) double x = Math.floor( -5.9);

i) double z = Math.floor(0);

j) double s = Math.floor( 9.0);

Answered by deviprema0312
1

Answer:

a)Output : 6.0

b)Output : 6.0

c)Output : -5.0

d)Output : -5.0

e)Output : 1.0

f)Output : 5.0

g)Output : -6.0

h)Output : -6.0

i)Output : -1.0

j)Output : 8.0

Explanation:

ceil - this function returns smallest whole no. greater than or equal to the no. by rounding up

floor - this function returns largest whole no. less than or equal to the no. by rounding down

Mark my answer Brainlist

Similar questions