Learn C# .Net MCQs

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

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

1) Reverse()

2) ToCharArray()

3) Array.Reverse()

4) None of the above

Answer : Array.Reverse()

What is the output of Console.WriteLine("Hello"[4]);?

1) o

2) l

3) H

4) Error

Answer : o

Which of the following is true about method overloading in C#?

1) It allows multiple methods with the same name.

2) It allows methods to have the same parameters.

3) It only applies to constructors.

4) None of the above

Answer : It allows multiple methods with the same name.

Which of the following is the correct way to handle asynchronous tasks in C#?

1) async-await

2) async

3) await

4) None of the above

Answer : async-await

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

1) String.Format()

2) Format()

3) StringBuilder()

4) None of the above

Answer : String.Format()

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

1) false

2) true

3) Error

4) None of the above

Answer : false

Which of the following is the correct way to declare a constant in C#?

1) const

2) readonly

3) static

4) None of the above

Answer : const

Which of the following is used to remove an item from a list in C#?

1) Remove()

2) Delete()

3) Clear()

4) None of the above

Answer : Remove()

Which of the following is true about the "out" keyword in C#?

1) It passes parameters by reference.

2) It passes parameters by value.

3) It is used with return statements.

4) None of the above

Answer : It passes parameters by reference.

What is the output of Console.WriteLine(10 / 2);?

1) 5

2) 10

3) 2

4) None of the above

Answer : 5