I had the same issue. The basic case:
when you want to get float output from two integers, you need to convert one into float
int c = 15;
int b = 8;
printf("result is float %f\n", c / (float) b); // result is float 1.875000
printf("result is float %f\n", (float) c / b); // result is float 1.875000