ExamVeda
Login
Home
71
Select the namespace which should be included while making use of LINQ operations?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
72
What will be the output of the following C# code snippet?
class Program
    {
        static void Main(string[] args)
        {
 
            int[] nums = { 1, -2, -3, 5 };
            var posNums = from n in nums
                          orderby n descending
                          select n*4 / 2;
            Console.Write("The values in nums: ");
            foreach (int i in posNums) Console.Write(i + " ");
            Console.WriteLine();
            Console.ReadLine();
        }
    }
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
73
What will be the output of the following C# code snippet?
class A {}
class B : A {}
class CheckCast 
{
    static void Main() 
    {
        A a = new A();
        B b = new B();
        b = a as B;
        b = null;
        if(b==null)
        Console.WriteLine("The cast in b = (B) a is NOT allowed.");
        else
        Console.WriteLine("The cast in b = (B) a is allowed");
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
74
Select the statement which are correct about RTTI(Runtime type identification)?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
75
In the following C# code, what does the output represent?
class Program
{
    static void Main(string[] args)
    {
        int[] nums = { 1, -2, 3, 0, -4, 5 };
        var posNums = from n in nums
                      where n > 0
                      select n;
        int len = posNums.Count();
        Console.WriteLine(len);
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
76
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();
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
77
What does the following C# code signify?
expr is type
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
78
Which operator among the following is used to perform the operation of boxing, unboxing, reference and identity conversions?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
79
What does the following property define in C#?
public static int BinarySearch<T>(T[] array, int index, int length, T value)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
80
What will be the output of the following C# code snippet?
class Program
{
    static void Main(string[] args)
    {
        Expression<Func<int, int, bool>>
        IsFactorExp = (n, d) => (d != 0) ? (n % d) == 0 : false;
        Func<int, int, bool> IsFactor = IsFactorExp.Compile();
        if (IsFactor(10, 5))
        Console.WriteLine("5 is a factor of 10.");
        if (!IsFactor(343, 7))
        Console.WriteLine("7 is not a factor of 10.");
        Console.ReadLine();
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board