Learn C# .Net MCQs

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

Which of the following is used to pause a thread in C#?

1) Thread.Sleep()

2) Pause()

3) Wait()

4) None of the above

Answer : Thread.Sleep()

What is the output of Console.WriteLine(Math.Abs(-10));?

1) 10

2) -10

3) Error

4) None of the above

Answer : 10

Which of the following is true about exception handling in C#?

1) Exceptions are caught using try-catch.

2) Exceptions are caught using if-else.

3) Exceptions cannot be caught.

4) None of the above

Answer : Exceptions are caught using try-catch.

What is the output of Console.WriteLine("C# Programming".Substring(2, 3));?

1) Programming

2) Pro

3) C#

4) Error

Answer : Pro

Which of the following is used to create a thread in C#?

1) new Thread()

2) create Thread()

3) Thread.Create()

4) None of the above

Answer : new Thread()

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

1) Value types store their value directly.

2) Value types store references to values.

3) Value types only store numeric data.

4) None of the above

Answer : Value types store their value directly.

What is the output of Console.WriteLine("Hello".Replace("l", "z"));?

1) Hezzo

2) Helo

3) Hzzlo

4) None of the above

Answer : Hezzo

Which of the following is used to remove all elements from a list in C#?

1) Clear()

2) RemoveAll()

3) Delete()

4) None of the above

Answer : Clear()

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

1) 5

2) 2

3) 10

4) None of the above

Answer : 5

Which of the following is used to check if an object is of a certain type in C#?

1) is

2) typeof()

3) GetType()

4) None of the above

Answer : is