42. In LINQ, what does the Reverse operator do?
43. What is the purpose of the Zip operator in LINQ?
44. Which LINQ operator is used to return elements from a sequence until a specified condition becomes false?
45. In LINQ, what does the ElementAtOrDefault operator do?
46. Can we use linq to query against a DataTable?
47. Which operator among the following supplies the information about the characteristics of a typeof?
48. What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
int[] nums = { 1, -2, 3, 0, -4, 5 };
var posNums = nums.Where(n => n < 10).Select(r => r%3);
Console.Write("The values in nums: ");
foreach (int i in posNums) Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
int[] nums = { 1, -2, 3, 0, -4, 5 };
var posNums = nums.Where(n => n < 10).Select(r => r%3);
Console.Write("The values in nums: ");
foreach (int i in posNums) Console.Write(i + " ");
Console.WriteLine();
Console.ReadLine();
}
}
49. Assume 2 columns named as Product and Category how can be both sorted out based on first by category and then by product name?
50. What will be the output of the following C# code snippet?
class B { }
class A : B { }
class Program
{
static void Main(string[] args)
{
A a = new A();
B b = new B();
if (a is A)
Console.WriteLine("a is an A");
if (b is A)
Console.WriteLine("b is an A because it is derived from A");
if (a is B)
Console.WriteLine("This won’t display -- a not derived from B");
Console.ReadLine();
}
}
class B { }
class A : B { }
class Program
{
static void Main(string[] args)
{
A a = new A();
B b = new B();
if (a is A)
Console.WriteLine("a is an A");
if (b is A)
Console.WriteLine("b is an A because it is derived from A");
if (a is B)
Console.WriteLine("This won’t display -- a not derived from B");
Console.ReadLine();
}
}