Dividing two integers to produce a float result [duplicate] August 30, 2022 by Tarik Cast the operands to floats: float ans = (float)a / (float)b;