You are dividing two integers, which will provide an integer result. In C, this means it will simply discard the fractional portion, leaving the 0.
You can cast one or both of the operands (a or b) as follows and it should clear up:
double result = (float) a / b;