Wipro Interview Question

Write a program to count words in the string