Answer:
//get the sentence from the user
Console.WriteLine("Enter your sentence");
//read the user information
string ans = Console.ReadLine();
//check if sentence ends with period
if(!ans.EndsWith("."))
{
Console.WriteLine("Sentence should end with period");
Environment.Exit(0);
}
//declear empty string firstword
string firstWord = "";
//split the requested sentence using single space character
string[] splitans = ans.Split(' ');
//assign firstword
firstWord = splitans[0];
//print out firstword
Console.WriteLine(firstWord);
Step-by-step explanation:
The program uses c#.