+ 1
[SOLVED]What is wrong ?
guys , can someone please tell me why is this program outputs average always on the form X.0000 ? for example it should output 5.2351 but it outputs 5.00000 ? I cannot figure out the reason. https://code.sololearn.com/cSslM42p8A2I/?ref=app
3 Antworten
+ 2
integer division is implicitly converted to float.
try average = (float)(j-count)/count; //line 18
don't use gets(); use fgets();
+ 1
try casting the "count" to float for your calculations.
+ 1
Flash thanks man