Computer Science, asked by naikharshinaik, 5 months ago

o
what is the output of the
expression print (-18 //4)​

Answers

Answered by dahiyakrishna39
4

Answer

-5

Explanation:

on dividing -18 by 4 we get -4.5

Since its floor division(//) , so we need to round off -4.5 which then will be -5.

Answered by AtharvSena
1

The output of the expression - print (-18 //4)​ is -5.

When using the floor division operator (//), the result is rounded to the next smallest (big negative) integer when the result is negative.

The / operator can be used to divide by a floor, also known as integer division. The first argument will be divided by the second argument by this operator, and the result will be rounded to the next whole number.

Thus, print (-18 //4)​ is -5.

#SPJ3

Similar questions