0
Hey Hi In this code why result is 3 Can you explain somebody
int x=15; int=4; int result=x/y system.out.println (result); why is 3
4 Answers
+ 1
listen if you want 3.25, then do this
float result = x/y
+ 1
It's not a matter of rounding up or down when it comes to integer devision, more so the 'extra decimals' are just cut off. The answer is 3.25, however as int was used, the answer is simply 3.
0
That is because your result is integer variable. So when you divide 15 by 4, the answer 3.25 is converted into integer 3 by dropping its decimal part
0
this mean that do become 15;4=results
or not...