iGET

C# Programming - MCQ Practice Questions

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

290 questions | 100% Free

Q.21Medium

Which of the following correctly demonstrates nullable type syntax in C#?

Q.22Medium

Which access modifier provides access within the same assembly only?

Q.23Medium

How many dimensions does a jagged array have in the following declaration: int[][] arr;

Q.24Medium

What is the correct way to check if a string is null or empty in modern C#?

Q.25Medium

Which of the following statements about properties in C# is TRUE?

Q.26Medium

What happens when you try to access an array element beyond its length in C#?

Q.27Medium

Which of the following demonstrates proper use of string interpolation in C# 6.0+?

Q.28Medium

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

Q.29Medium

Which of the following correctly demonstrates the use of an out parameter in C#?

Q.30Medium

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

Q.31Medium

Which collection type in C# automatically prevents duplicate values?

Q.32Medium

In C#, what is the difference between '==' and 'Equals()' when comparing strings?

Q.33Medium

What is the correct way to create a generic method in C#?

Q.34Medium

Which statement about anonymous functions in C# is TRUE?

Q.35Medium

What is the output of: var x = 5; Console.WriteLine(x.GetType().Name);

Q.36Medium

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

Q.37Medium

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

Q.38Medium

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

Q.39Medium

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

Q.40Medium

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