C Program to count number of words in a string