Vidyalelo
C# Programming · Q66

Delegates and Events in C Sharp

Programming · C# Programming · question 66

Q66

What will be the output of the following C# code? public class Generic public T Field; class Program static void Main(string[] args) Generic g2 = new Generic (); Generic g3 = new Generic (); g2.Field = 8; g3.Field = 4; if (g2.Field % g3.Field == 0) Console.WriteLine("A"); else Console.WriteLine("Prints nothing:"); Console.ReadLine();

A.
Compile time error
B.
A
Answer
C.
Run time error
D.
Code runs successfully but prints nothing

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board