Infosys Interview Question

Simple programming questions like: program count the number of words in a given sentence.