Learn C# .Net MCQs
Prepare C# .Net MCQs (Multiple choice Questions) for exam and job interviews.
Which of the following is not a looping construct in C#?
1) for
2) while
3) do-while
4) loop
Answer : loop
What is the output of Console.WriteLine(10 - 2 * 3);?
1) 4
2) 10
3) 6
4) None of the above
Answer : 4
Which keyword is used to define an abstract class in C#?
1) abstract
2) interface
3) class
4) None of the above
Answer : abstract
What is the purpose of the "base" keyword in C#?
1) To refer to the parent class.
2) To create an instance of a class.
3) To define a new class.
4) None of the above
Answer : To refer to the parent class.
What is the output of Console.WriteLine("5" + 2);?
1) 7
2) 52
3) Error
4) None of the above
Answer : 52
Which of the following is a C# value type?
1) string
2) int
3) array
4) None of the above
Answer : int
What is the output of Console.WriteLine(2 * 3 + 1);?
1) 7
2) 8
3) 6
4) None of the above
Answer : 7
Which operator is used to perform a bitwise AND operation in C#?
1) &
2) &&
3) |
4) None of the above
Answer : &
What is the output of Console.WriteLine("Hello".Length);?
1) 5
2) Error
3) Hello
4) None of the above
Answer : 5
Which of the following is used to implement inheritance in C#?
1) :
2) ->
3) extends
4) None of the above
Answer : :