Word counter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Word counter

Can someone help me to improve my code which counts words in a sentence using FOR loop in C language? Like If there were more whitespaces between the words or something like that, just to make it solid and more complex... https://code.sololearn.com/c5hBO6XaBqRd/?ref=app

22nd Oct 2018, 9:57 PM
Lone Wolf
Lone Wolf - avatar
1 Answer
+ 2
you can check and strip the space at the beginning and the end. check if there are another space before/after the current space.
22nd Oct 2018, 10:11 PM
Taste
Taste - avatar