how to get integer part of float in cpp code example Example: cpp get float from integer division float ans = (float)a / (float)b;