Computer Science, asked by Anonymous, 5 months ago

Can anyone Solve this (NOT just answer) I want Explanation

1. What would be the output of following Code ? Explain reason (s).
a=3+5/8
b=int(3+5/8)
c=3+float(5/8)
d=3+float(5)/8
e= 3+5.0/8
f=int(3+5/8.0)
print (a, b,c,d,e,f)

Answers

Answered by Anonymous
17

Solution

The Output would be

3.625 , 3 , 3.625 , 3.625 , 3.625 , 3

Explanation

a = 3 + 5/8

= 3 + 0.625

a = 3.625

b = int ( 3 + 5/8 )

= int ( 3+ 0.625 )

= int ( 3.625 )

b = 3

c = 3 + Float ( 5/8 )

c = 3 + float ( 0.625 )

= 3 + 0.625

d = 3.625

d = 3 + float ( 5 ) / 8

= 3 + 5.0/8

= 3 + 0.625

d = 3.625

e = 3 + 5.0/8

= 3 + 0.625

e = 3.625

f = int ( 3 + 5/8.0 )

f = int ( 3 + 0. 625 )

f =int ( 3.0 )

f = 3

Answered by jimin084
4

Answer:

sis u blocked me... y.

.

i love u

stay safe and happie

Similar questions