Vidyalelo
C# Programming · Q52

Miscellaneous in C Sharp

Programming · C# Programming · question 52

Q52

What does the yield return statement specify in the following C# code snippet? public System.Collections.IEnumerator GetEnumerator() foreach (char ch in chrs) yield return ch;

A.
returns the output
B.
returns the next object in the collection
Answer
C.
Both returns the output & returns the next object in the collection
D.
none of the mentioned

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board