Can somebody explain the output of the following code: http://cpp.sh/9dy44
Why is the last line always 0.17?
float a = 17, b = 100;
printf("%f\n", 17/100);
printf("%f\n", a/b);
printf("%f\n", 17/b);
printf("%f\n", 17.0f/b);
printf("%f\n", a/100);
printf("%f\n", a/100.0f);
printf("%f\n", 5/100);
output
0.000000
0.170000
0.170000
0.170000
0.170000
0.170000
0.170000