0
Typo in this question?
The question gave this code and asked for an answer: int x = 15; int y = 4; int result = x / y; System.out.println(result); It only accepts on number, yet this isn't an integer. Appearently it was 3? Last time I checked 4*3 is 12 not 15. Is this something i'm missing or is it a typo?
3 Réponses
+ 2
it's Integer Division which always rounds down.. so the correct answer is 15/4 = 3.75 -> 3
+ 2
whoops there was someone a little bit faster :D