0
Why is the output 8? And not 10.6666667
double y = 4; y = y * (8 / 3);
1 Réponse
+ 5
because you have to cast one of the numbers in the division to a double.
double y = 4;
y = y * ((double)8 / 3);
without casting it to double, (8/3) = 2