Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#yield return generatorsSingle-choice MCQ

What is the result of running this code that combines two infinite-ish iterators with deferred execution?

static IEnumerable<int> Source() { for (int i = 0; ; i++) yield return i; } var q = Source().Where(x => x % 2 == 0).Select(x => x * 10); Console.WriteLine(string.Join(",", q.Take(3)));