read the file character by charecter upto EOF. if any of the character is equal to the ' ' single space or EOF increase the wordcount value by one