Classes And Objects In C Sharp - Study Mode

[#141] Which statements are correct about operator overloading?
Correct Answer

(D) All of the mentioned

[#142] Choose the wrong statement from the given set of statements?
Correct Answer

(D) In case of operator overloading all parameters must be of different type than the class or struct that declares the operators

[#143] Operators that can be overloaded are?
Correct Answer

(C) +

[#144] Which of the following cannot be used to declare a class as a virtual?
Correct Answer

(D) Fields

[#145] What will be the output of the following C# code? static void Main(string[] args)
{
int []a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

func(ref a)

Console.ReadLine()

}
static void func(ref int[] x)
{
Console.WriteLine(" numbers are:")

for (int i = 0

i < x.Length

i++)
{
if (x[i] % 2 == 0)
{
x[i] = x[i] + 1

Console.WriteLine(x[i])

}
}
}
Correct Answer

(B) numbers are : 3 5 7 9 11