public static void Main()
Console.Write("Input the string : ");
string str = Console.ReadLine();
Console.Write("Total number of words in the string is : "+ getNumberOfWords(str));
private static int getNumberOfWords(string str) {
string[] arrayChar = str.Split(' ');