Since neither number has a decimal point they are taken to be integers, implying that the result has to be an integer ... and so it does integer division, truncating, where necessary, toward zero. Thus 45/10 becomes the integer 4.
This is then assigned to the double x, becoming, at this point, 4.0.
As I said, if you want the more accurate answer, at least one of 45 and 10 must either be given a decimal point or explicitly cast to a double.
Remember that the RHS is worked out first, before your code starts worrying what it will assign it to subsequently.