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
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
Math,
3 months ago
English,
3 months ago
English,
3 months ago
Computer Science,
7 months ago
Art,
7 months ago