82. What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
int[] nums = {3, 1, 2, 5, 4};
var ltAvg = from n in nums
let x = nums.Average()
where n < x
select n;
Console.WriteLine("The average is " + nums.Average());
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
int[] nums = {3, 1, 2, 5, 4};
var ltAvg = from n in nums
let x = nums.Average()
where n < x
select n;
Console.WriteLine("The average is " + nums.Average());
Console.ReadLine();
}
}
83. Which method will be used to copy content from one array to another array?
84. Choose the correct statement about the IComparer interface in C#?
85. What will be the output of the following C# code snippet?
class Program
{
static void Main(string[] args)
{
string[] strs = {"alpha", "beta", "gamma"};
var chrs = from str in strs
let chrArray = str.ToCharArray()
from ch in chrArray
orderby ch
select ch;
Console.WriteLine("The individual characters in sorted order:");
foreach (char c in chrs)
Console.Write(c + " ");
Console.WriteLine();
Console.ReadLine();
}
}
class Program
{
static void Main(string[] args)
{
string[] strs = {"alpha", "beta", "gamma"};
var chrs = from str in strs
let chrArray = str.ToCharArray()
from ch in chrArray
orderby ch
select ch;
Console.WriteLine("The individual characters in sorted order:");
foreach (char c in chrs)
Console.Write(c + " ");
Console.WriteLine();
Console.ReadLine();
}
}