Q47
What will be the following C# code snippet specify? class MyClass char chrs = 'A' ; public IEnumerator GetEnumerator() for (int i = 20; i >=0; --i) if (i == 10) yield break; yield return (char)((chrs + i)); class Program static void Main(string[] args) MyClass mc = new MyClass(); foreach (char ch in mc) Console.Write(ch + " "); Console.WriteLine(); Console.ReadLine();
A.
Code run successfully prints nothing
B.
A B C D E F G H I J K L M N O P Q R S T U V
C.
U T S R Q P O N M L
AnswerD.
Compile time error
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board