This is happening to you because you are only declaring n as a double data type. While n = 99/100, these values are not double data types. Therefore, the compiler is outputting an integer and not a double. You either need to declare both values as double by naming them or you need to make those two value double data types by adding .0 after each of them.
double n = 99.0/100.0;
This is telling the compiler that this is a double data type which will eventually lead to the output of a double.
Another solution that would work would be to name each of the values. I used x and y. This is useful because you can then declare each of the values separately as a double data type instead of the whole quantity, n. You then need to tell the compiler to output the quantity (x/y). Since these two values were declared double, they will output a double data type of 0.99.
double x = 99; double y = 100; System.out.println(x/y);