Divison - Double
I'm slightly confused by a couple of questions i have to answer for some Java work [I'm new to it].
The first is:
What is the result of 100/3? 100/3.0? Explain why are these different?
To which i wrote:
The difference is if you don't specify the .0 then it treats the answer as a simple (int) and rounds the answer to a whole number . Whereas if you Do specify the .0 it treats it as a decimal number using (double) and so returns a decimal answer [33.333..]
But the next 3-4 questions all seem to be asking the exact same thing:
What is the result of 1/10? Explain
What is the result of 4/6? 4.0/6.0? Explain why are these different?
What is the result of (5/2)*3.0? (5/2)*3? Explain why are these different?
So that leads me to believe that i'm missing something, otherwise they wouldn't keep asking the same question if it was the same answer all the time..
So, is that the case? Am i missing something, or are they actually just asking the same question 4 times with the same answer 4 times?
I think, they are asking the same question:)