Learn C# .Net MCQs

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

Which of the following operators is used for string concatenation in C#?

1) +

2) &

3) concat

4) None of the above

Answer : +

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

1) 2.5

2) 2

3) Error

4) None of the above

Answer : 2.5

Which of the following is not an access modifier in C#?

1) private

2) protected

3) public

4) local

Answer : local

What is the output of Console.WriteLine("C#" + 1 + 2);?

1) C#12

2) C#3

3) C#6

4) None of the above

Answer : C#12

Which of the following is the correct way to define a class in C#?

1) class MyClass {}

2) MyClass class {}

3) define class MyClass {}

4) None of the above

Answer : class MyClass {}

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

1) 7

2) 10

3) 5

4) None of the above

Answer : 7

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

1) new

2) create

3) instantiate

4) None of the above

Answer : new

What is the default value of a boolean variable in C#?

1) true

2) false

3) 0

4) 1

Answer : false

Which of the following is used to catch exceptions in C#?

1) try

2) catch

3) throw

4) None of the above

Answer : catch

What is the output of Console.WriteLine(5 == 5 && 3 > 2);?

1) true

2) false

3) Error

4) None of the above

Answer : true