What will be the output of the following C# code snippet?
static void Main(string[] args)
{
string[] strings = {"beta", "alpha", "gamma"};
Console.WriteLine("Array elements: ");
DisplayArray(strings);
Array.Reverse(strings);
Console.WriteLine("Array elements now: ");
DisplayArray(strings);
Console.ReadLine();
}
public static void DisplayArray(Array array)
{
foreach (object o in array)
{
Console.Write("{0} ", o);
}
Console.WriteLine();
}
static void Main(string[] args)
{
string[] strings = {"beta", "alpha", "gamma"};
Console.WriteLine("Array elements: ");
DisplayArray(strings);
Array.Reverse(strings);
Console.WriteLine("Array elements now: ");
DisplayArray(strings);
Console.ReadLine();
}
public static void DisplayArray(Array array)
{
foreach (object o in array)
{
Console.Write("{0} ", o);
}
Console.WriteLine();
}A. Array elements:
beta alpha gamma
Array elements now:
ammag ahpla ateb
B. Array elements:
beta alpha gamma
Array elements now:
gamma beta alpha
C. Array elements:
beta alpha gamma
Array elements now:
gamma alpha beta
D. None of the mentioned
Answer: Option C
What does LINQ stand for in C#?
A. Lightweight Query
B. Linked Query
C. Language-Integrated Query
D. Loaded Query
Which namespace in C# provides the LINQ extension methods?
A. System.Query
B. System.Linq
C. System.Data
D. None of the above
What is the purpose of the Select operator in LINQ?
A. Groups the elements of a sequence
B. Orders the elements of a sequence
C. Projects each element of a sequence
D. Filters a sequence based on a predicate
In LINQ, what is the purpose of the Where operator?
A. Projects each element of a sequence
B. Orders the elements of a sequence
C. Groups the elements of a sequence
D. Filters a sequence based on a predicate

Join The Discussion