0
What is the output of this code :- 22 / 5*3 and why?
4 odpowiedzi
+ 3
-12,if values are in int
+ 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
+ 2
Android Developer, you mean “-12” minus?
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