Learn C# .Net MCQs

Prepare C# .Net MCQs (Multiple choice Questions) for exam and job interviews.

What is the output of Console.WriteLine(5 > 10);?

1) false

2) true

3) Error

4) None of the above

Answer : false

Which of the following is used to check if two objects are equal in C#?

1) Equals()

2) isEqual()

3) Compare()

4) None of the above

Answer : Equals()

Which of the following is used to add elements to an array in C#?

1) You cannot add elements to an array.

2) Add()

3) Insert()

4) Append()

Answer : You cannot add elements to an array.

What is the output of Console.WriteLine(2 * 3 + 1);?

1) 7

2) 9

3) 5

4) None of the above

Answer : 7

Which of the following is used to terminate a loop in C#?

1) break

2) exit

3) stop

4) None of the above

Answer : break

Which of the following is used to append text to a string in C#?

1) +=

2) Append()

3) Concat()

4) None of the above

Answer : +=

What is the output of Console.WriteLine(5 == 5);?

1) true

2) false

3) Error

4) None of the above

Answer : true

Which of the following is true about reference types in C#?

1) Reference types store references to objects.

2) Reference types store values directly.

3) Reference types can only store numeric data.

4) None of the above

Answer : Reference types store references to objects.

Which of the following is used to get the current date in C#?

1) DateTime.Now

2) CurrentDate()

3) GetDate()

4) None of the above

Answer : DateTime.Now

What is the output of Console.WriteLine("World".Substring(1));?

1) orld

2) orldW

3) Worl

4) None of the above

Answer : orld