public static void Main()
Console.WriteLine("Enter a sentence:");
string sentence = Console.ReadLine();
Console.WriteLine("Enter the word to replace:");
string oldWord = Console.ReadLine();
Console.WriteLine("Enter the replacement word:");
string newWord = Console.ReadLine();
string updatedSentence = sentence.Replace(oldWord, newWord);
Console.WriteLine("Updated sentence: " + updatedSentence);