c++ float division 0 code example Example: cpp get float from integer division float ans = (float)a / (float)b;