C# Programming - MCQ Practice Questions
C# (.NET) MCQs — OOP, collections, LINQ & exception handling.
290 questions | 100% Free
What will be the output of the following code snippet? int x = 5; int y = ++x; Console.WriteLine(x + " " + y);
Which of the following data types in C# is a value type?
What is the correct way to declare a constant variable in C#?
What is the difference between '==' and 'Equals()' when comparing strings in C#?
Which of the following will correctly convert a string to an integer in C#?
Which of the following correctly declares a nullable integer in C#?
What is the output of the following code? bool result = (5 > 3) && (2 < 1); Console.WriteLine(result);
Which keyword is used to prevent a class from being inherited in C#?
What will happen when you try to access an array index that is out of bounds in C#?
Which keyword is used to create an immutable class member in C#?
What is the difference between 'var' and explicit type declaration in C#?
What will happen if you try to access an array element beyond its bounds?
What is the output of: int x = 5; Console.WriteLine(x++);
Which of the following statements about abstract classes is correct?
Which access modifier allows access from derived classes only?
What is the output of: Console.WriteLine(5 == 5.0);
Which of the following correctly declares a jagged array?
What is the purpose of the 'using' statement in C#?
What will be the output of: int x = 10; int y = x; y = 20; Console.WriteLine(x);
What will be the output of: sbyte x = -128; sbyte y = x - 1; Console.WriteLine(y);