0

What is the output of this code :- 22 / 5*3 and why?

18th May 2019, 8:04 AM
Anuj Raghu
Anuj Raghu - avatar
4 Answers
+ 3
-12,if values are in int
18th May 2019, 10:39 AM
Muhammad Rashid
Muhammad Rashid - avatar
+ 2
If you are talking about python the result is: 13.200000000000001 22 / 5 gives a float of 4.4 as the result 4.4 * 3 = 13.200000000000001 ..01 is coming from inaccuracy in the calculation with floating point numbers. So result is: 13.2
18th May 2019, 9:38 AM
Lothar
Lothar - avatar
+ 2
Android Developer, you mean “-12” minus?
18th May 2019, 10:46 AM
Lothar
Lothar - avatar
0
I'm guessing the question was in Java, or C or something, because then it has to be an integer. 22/5*3 22/5 -> 4, because it returns and integer as a result. 4*3 = 12, therefore the answer is 12
18th May 2019, 8:27 AM
Airree
Airree - avatar