Welcome to the Miscellaneous Topics MCQs Page
Dive deep into the fascinating world of Miscellaneous Topics with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Miscellaneous Topics, a crucial aspect of C# Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Miscellaneous Topics, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# Programming.
Check out the MCQs below to embark on an enriching journey through Miscellaneous Topics. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# Programming.
Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Miscellaneous Topics. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!
Miscellaneous Topics MCQs | Page 9 of 17
Explore more Topics under C# Programming
class MyClass
{
char[] chrs = { 'A', 'B', 'C', 'D' };
public System.Collections.IEnumerator GetEnumerator()
{
foreach (char ch in chrs)
yield return ch;
}
}
class Program
{
static void Main(string[] args)
{
MyClass mc = new MyClass();
foreach (char ch in mc)
Console.Write(ch + " ");
Console.WriteLine();
Console.ReadLine();
}
}
public System.Collections.IEnumerator GetEnumerator()
{
foreach (char ch in chrs)
yield return ch;
}
class MyClass
{
char chrs = 'A' ;
public IEnumerator GetEnumerator()
{
for (int i = 20; i >=0; --i)
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();
}
}
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();
}
}
class MyClass
{
int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
public IEnumerator GetEnumerator()
{
for (int i = 0; i < 20; i++)
{
if (a[i] % 2 == 0)
yield return (int)(a[i]);
}
}
}
class Program
{
static void Main(string[] args)
{
MyClass mc = new MyClass();
foreach (int i in mc)
Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
}
class MyClass
{
char ch = 'A';
public IEnumerable MyItr(int end)
{
for (int i = 0 ;i < end ;i++)
yield return (char)(ch + i);
}
public IEnumerable MyItr(int begin, int end)
{
for (int i = begin ;i < end ;i++)
yield return (char)(ch + i);
}
}
class Program
{
static void Main(string[] args)
{
MyClass mc = new MyClass();
Console.WriteLine("Iterate the first 7 letters:");
foreach (char ch in mc.MyItr(7))
Console.Write(ch + " ");
Console.WriteLine("n");
Console.WriteLine("Iterate letters from F to L:");
foreach (char ch in mc.MyItr(7, 12))
Console.Write(ch + " ");
Console.WriteLine();
Console.ReadLine();
}
}
A B C D E F G
Iterate letters from F to L:
H I J K L
Suggested Topics
Are you eager to expand your knowledge beyond C# Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!