You get these error because x/y results in slightly less than 10 (it surely is less than 10^-12 off, otherwise the other result wouldn't show as 10.000000000000), probably due to the usual floating point math rounding errors.
use this you will get the right result printf("%3.10f\t %3.2f\t %3.12f\t %d\n",x,y,x/y,(int)(round(x/y)));
because casting to int doesn't round a double to the nearest integer but the conversion to int is a brutal truncation, thus, even if it's 9.99999999999999... you get 9 as a result.