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