0

i stuck in a quiz, pls help

What is the result of the following code? int x = 15; int y = 4; int result = x / y; System.out.println(result);

9/13/2019 5:44:22 AM

ucef-kacy

3 Answers

New Answer

+2

It's 3 Because 15 / 4 = 3 rem 3 but it's rounded down

+1

Please revise your datatypes section again and see what type of data integer data holds. Or use your Xp's to get hint.

0

Since both data types are integer, you will get an integer result instead of floating point number. If you wanna get that desired number, use 15 / 4.0 or 15.0 / 4.0