What will be the output of the following C# code?
static void Main(string[] args)
{
String name = "Dr.Gupta";
Console.WriteLine("Good Morning" + name);
}
static void Main(string[] args)
{
String name = "Dr.Gupta";
Console.WriteLine("Good Morning" + name);
}A. Dr.Gupta
B. Good Morning
C. Good Morning Dr.Gupta
D. Good Morning name
Answer: Option C
Related Questions on Basic Syntax and Data Types in C Sharp
What is the correct syntax to declare a variable in C#?
A. num = int;
B. var num;
C. num int;
D. int num;
What is the purpose of the 'var' keyword in C#?
A. Declares a constant
B. Converts a variable to string
C. Implicitly declares a variable
D. Defines a method

Join The Discussion