iGET

C# Programming - MCQ Practice Questions

C# (.NET) MCQs — OOP, collections, LINQ & exception handling.

290 questions | 100% Free

Q.61Medium

Which of the following is a correct implementation of property with auto-backing field in C#?

Q.62Hard

In C#, what is the primary purpose of the 'using' statement?

Q.63Hard

What will be the result of: string text = null; Console.WriteLine(text ?? "Default");

Q.64Hard

Which of the following correctly demonstrates method overloading in C#?

Q.65Hard

What is the output of: int x = 10; int y = x++; Console.WriteLine(x + ", " + y);

Q.66Easy

In C#, which keyword is used to declare a variable that cannot be changed after initialization?

Q.67Easy

What is the default access modifier for a class member in C# if not explicitly specified?

Q.68Easy

Which statement correctly describes value types in C#?

Q.69Medium

What will be the output of the following code? int a = 5; int b = ++a; Console.WriteLine(a + " " + b);

Q.70Medium

Which of the following correctly demonstrates string interpolation in C# 6.0 and above?

Q.71Medium

In C#, what is the difference between 'struct' and 'class'?

Q.72Medium

Which method is used to convert a string to an integer in C#?

Q.73Easy

What is the output of: bool result = (5 > 3) && (3 < 2); Console.WriteLine(result);

Q.74Medium

Which of the following is a nullable type in C#?

Q.75Medium

In C#, what does the 'params' keyword allow you to do?

Q.76Medium

What will be the output of: string s1 = "Hello"; string s2 = "Hello"; Console.WriteLine(s1 == s2);

Q.77Medium

Which collection type in C# maintains insertion order and allows duplicate elements?

Q.78Medium

What is the purpose of the 'abstract' keyword in C#?

Q.79Hard

In C#, which keyword is used to implement multiple interface inheritance?

Q.80Hard

What will be the output of: decimal price = 19.99m; Console.WriteLine(price.GetType().Name);