Q. What would be the output produced by the print statements given below?
import math
(a) print(5/2)
(b) print(5.0//2)
(c) print((int) ( 5 //2))
(d) print(math.fabs (-5.0 / 2))
(e) print(math.fabs ( -5 // 2))
(f) print(math.fabs(-3//2))
(g) print(-5/2)
(h) print(-5/2)
(i) print (-5//2)
(j) print(-5.0//2)
Answer :-
Output :-
(a) 2.5
(b) 2.0
(c) 2
(d) 2.5
(e) 3.0
(f) 2.0
(g) -2.5
(h) -2.5
(i) -3
(j) -3.0
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )