🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

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

What will be the output of the following code?


print(-18//4)

A
-4
B
-5
C
4
D
5
Explanation

Given code:

 
print(-18 // 4)
 
यहाँ // है floor division operator, जो हमेशा नीचे की ओर (towards negative infinity) round करता है — not towards zero.

🔍 Step-by-step:

  • -18 ÷ 4 = -4.5

  • Floor division (//) rounds it down to the nearest integer:

    🔻 floor(-4.5) = -5


✅ Final Output: -5

Correct Answer: B) -5

Latest Updates