how to convert integer to float in c++ code example Example: int to float c++ int a = 3; float b = (float)a;