trying to convert an int into a float c gives different number as result code example Example: int to float c float percentage; percentage = (float)number/total * 100;