+ 2

Why am I getting the values after decimal zero when they are not supposed to be zero??

In this code I have taken the mean as float type, for accuracy of the mean. But still the value of mean is restricted before decimal. https://code.sololearn.com/cPBz8gj15Ank/?ref=app

3rd Feb 2019, 12:25 PM
Shirshendu Dey
Shirshendu Dey - avatar
1 Respuesta
+ 7
U declared int sum = 0; Declare sum as float.. Or use typecast mean=(float)sum/5
3rd Feb 2019, 12:43 PM
Saurabh B
Saurabh B - avatar