Vidyalelo
C# Programming · Q79

Classes and Objects in C Sharp

Programming · C# Programming · question 79

Q79

What will be the output of the following C# code? class test public void print() Console.WriteLine("Csharp:"); class Program static void Main(string[] args) test t; t.print(); Console.ReadLine();

A.
Code runs successfully prints nothing
B.
Code runs and prints "Csharp"
C.
Syntax error as t is unassigned variable which is never used
Answer
D.
None of the mentioned

Answer: Option C

Solution

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