Learn C# .Net MCQs
Prepare C# .Net MCQs (Multiple choice Questions) for exam and job interviews.
Which of the following is used to read input from the console in C#?
1) Console.ReadLine()
2) Console.Read()
3) Console.Input()
4) None of the above
Answer : Console.ReadLine()
What is the output of Console.WriteLine(2 + 3 * 4);?
1) 14
2) 20
3) 10
4) None of the above
Answer : 14
Which of the following is true about the "override" keyword in C#?
1) It is used to override a base class method.
2) It is used for constructor overriding.
3) It is used to override private methods.
4) None of the above
Answer : It is used to override a base class method.
What is the output of Console.WriteLine(10 != 10);?
1) false
2) true
3) Error
4) None of the above
Answer : false
Which of the following is used to create a file in C#?
1) File.Create()
2) File.New()
3) File.Init()
4) None of the above
Answer : File.Create()
What is the output of Console.WriteLine("Welcome".Contains("come"));?
1) true
2) false
3) Error
4) None of the above
Answer : true
Which of the following is used to sort an array in C#?
1) Array.Sort()
2) Array.Order()
3) Array.Arrange()
4) None of the above
Answer : Array.Sort()
Which of the following is true about the "abstract" keyword in C#?
1) It is used for creating abstract classes.
2) It is used to prevent instantiation of a class.
3) It is used to hide implementation details.
4) None of the above
Answer : It is used for creating abstract classes.
What is the output of Console.WriteLine(5 > 3 ? "Yes" : "No");?
1) Yes
2) No
3) Error
4) None of the above
Answer : Yes
Which of the following is used to convert a string to a double in C#?
1) double.Parse()
2) StringToDouble()
3) Convert.ToDouble()
4) None of the above
Answer : double.Parse()