0

I need help completing this code

using System; using System.Collections.Generic; namespace Code_Coach_Challenge { class Program { static void Main(string[] args) { string[] words = { "home", "programming", "victory", "C#", "football", "sport", "book", "learn", "dream", "fun" }; string letter = Console.ReadLine(); foreach (var word in words) { if (word.Contains(letter)) { Console.WriteLine(word); } } } } }

26th Jan 2022, 9:33 PM
Godfred Opintan
Godfred Opintan - avatar
2 Antworten
+ 1
Thanks 👍👍👍
26th Jan 2022, 10:22 PM
Godfred Opintan
Godfred Opintan - avatar
0
Well in case the the input letter isn't found on any of words in the array, it supposed to print "Not found". When first attempted, it printed that for every word it didn't find the input letter except for the once that have the letter in them.
26th Jan 2022, 10:04 PM
Godfred Opintan
Godfred Opintan - avatar