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

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

What is the output of the following program ?

print 0.1+0.2==0.3
A)
B)
C)
D)

Explanation:

Let's analyze the given Python program:

print 0.1 + 0.2 == 0.3

Explanation:

  • In Python, floating-point numbers like 0.1, 0.2, and 0.3 cannot always be represented precisely due to the way floating-point arithmetic works in computers.
  • When you compute 0.1 + 0.2, it may result in a value slightly different from 0.3 because of precision errors in floating-point representation.

Specifically:

  • 0.1 + 0.2 results in 0.30000000000000004, which is not exactly equal to 0.3.

Thus, the expression 0.1 + 0.2 == 0.3 evaluates to False.

Output:

(B) False

Latest Updates