Report Bug
Qus :

What will be the output of the following expression ?

print (7//2)
print (-7//2)

Qus

निम्नलिखित कोड का आउटपुट क्या होगा ?

print (7//2)
print (-7//2)


A. 3 -3
B. 4 -4
C. 3 -4
D. 3 3


Solution
C. 3 -4



Explanation

// operator known as floor division which return the floor value of division 

7//2 = floor(7/2) => floor(3.5) =>3

-7//2= floor(-7/2) => floor(-3.5) => -4

so the correct answer is: 3 -4














Report Bug