.NET Programming MCQs with answers Page - 27

Here, you will find a collection of MCQ questions on .NET Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the output type of a LINQ `Count()` method?

  • (A) string
  • (B) decimal
  • (C) int
  • (D) bool

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `yield return` do in C#?

  • (A) Terminates method execution
  • (B) Pauses and resumes method execution
  • (C) Returns all values at once
  • (D) Throws an exception

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which collection class maintains the insertion order?

  • (A) Stack
  • (B) Queue
  • (C) Dictionary
  • (D) HashSet

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which method can be used to convert a string to uppercase in C#?

  • (A) ToUpper()
  • (B) MakeUpper()
  • (C) ConvertUpper()
  • (D) UpperCase()

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the use of `??` operator in C#?

  • (A) Null checking and fallback
  • (B) Bitwise operation
  • (C) Type casting
  • (D) String formatting

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `string.IsNullOrEmpty()` check for?

  • (A) Only null
  • (B) Only empty string
  • (C) Null or empty
  • (D) Null or whitespace

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which type of loop guarantees at least one execution?

  • (A) for
  • (B) while
  • (C) do-while
  • (D) foreach

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which keyword is used to define a property in C#?

  • (A) prop
  • (B) getset
  • (C) property
  • (D) get; set;

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the role of the `Main()` method in a C# console application?

  • (A) Handles exceptions
  • (B) Defines application settings
  • (C) Serves as the entry point
  • (D) Initializes the database

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which component of .NET compiles IL to machine code at runtime?

  • (A) CLR
  • (B) JIT Compiler
  • (C) CTS
  • (D) FCL

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ