what is the output of the following C# code: using system; class Example { char[]xyz={'M','N','O','P'}; public system.Collections.IEnumerator
Fantastic news! We've Found the answer you've been seeking!
Question:
what is the output of the following C# code:
using system;
class Example
{
char[] xyz = { 'M' , 'N' , 'O' , 'P' };
public system.Collections.IEnumerator
GetEnumerator()
{
foreach (char ch in xyz)
yeild return ch;
}
}
class program
{
static void main(string[] args)
{
Example mc = new Example();
foreach (char ch in mc)
Console.Write(ch + " ");
}
}
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: