static void Main(string[] args)
Console.WriteLine("Enter a sentence: ");
string sentence = Console.ReadLine();
int wordCount = CountWords(sentence);
Console.WriteLine("There are " + wordCount + " words in that sentence.");
static int CountWords (string sentence)
int wordCount = sentence.Split(' ').Length;