You can change the data type of total to float or double. Then, it will display the floating point values obtained and not round them off.