What is the result of the following code?
int x = 15; int y = 4;
int result = x / y;
9/13/2019 5:44:22 AM
Because 15 / 4 = 3 rem 3 but it's rounded down
Please revise your datatypes section again and see what type of data integer data holds.
Or use your Xp's to get hint.
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
GET THE FREE APP
Learn Playing. Play Learning
Send us a message