Computer Science, asked by chavitripathimusyin, 7 months ago

Following code has an expression with all integer values. Why is the result in floating point form
a,b,c=2,3,6
d=a+b*c/b
print(d)​

Answers

Answered by navisandhu28
3

Answer:

because the way you are writing is ugly way to write a code

you can write it D = (a + b ) * (c / b)

if your answer is coming in floating it means it doing

2+3*3/6, 5*3/6, 15/6= 2.5

or else you want an integer value of this float value you can use int(value) also

Similar questions