INFORMATICS
132
4. Give the output of the following when num1 = 4, num2 ='3, num3 = 2
(a) num1 += num2 + num3
(g) num1 = float(10)
print(num1)
print(num1)
(b) num1 = num1 ** (num2 + num3) (h) num1 = int("3.14')
print(num1)
print(num1)
(C) num1 **= num2 + num3
(i) print(10 != 9 and 20 >= 20)
(d) num1 = '5' + '5'
(1) print(5 % 10 + 10 < 50 and 29 <= 29)
print(num1)
(e) print(4.00/(2.0+ 2.0))
() num1 = 2 +9* ((3 * 12) - 8)/10
print(num1)
Answers
Answered by
0
Answer:
Explanation: Neither of 0.1, 0.2 and 0.3 can be represented accurately in binary. The round off errors from 0.1 and 0.2 accumulate and hence there is a difference of 5.5511e-17 between (0.1 + 0.2) and 0.3.
Similar questions