0

(Solved)Little help needed with average word length quiz in sololearn. Have a nice day!

I have did a code for the average word length quiz. My code displays the the average length of the words rounded "up" (for example, 5.2 to 6). But my code fails the 5th test case and I don't know why. Any help would be greatly appreciated. PS: this is my 15th code I think. I've tried a lot and also searched the forum and the internet but couldn't find a solution. If you can help, thank you so much. https://code.sololearn.com/cZPNJwCHHz9o/?ref=app

14th Jun 2021, 10:42 AM
Rishi
Rishi - avatar
4 Réponses
+ 1
all i did was: make it int main() instead of void main(), returned a value 0 for the return statement not given a value, added a return 0; at the bottom, and included math.h https://code.sololearn.com/cCqtJAR6jxuY/?ref=app
14th Jun 2021, 11:02 AM
Slick
Slick - avatar
+ 1
i took away your call to ceil() at the bottom and it got 5
14th Jun 2021, 3:15 PM
Slick
Slick - avatar
+ 1
Slick when I take away the ceil() function, I pass only the first test case
15th Jun 2021, 2:38 AM
Rishi
Rishi - avatar
0
Slick actually it works fine already. But the problem comes in when the sololearn tries the test cases. Even if I change the return type to int and add return statements, test case 5 fails. Try this code in sololearn quiz "average word length"
14th Jun 2021, 2:47 PM
Rishi
Rishi - avatar