.NET Programming MCQs with answers Page - 52

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

A

Admin • 833.24K Points
Coach

Q. What will be the output?

Code:
async Task Test()
{
    await Task.Delay(1000);
    Console.WriteLine("Done");
}
  • (A) Compilation error
  • (B) Done
  • (C) Nothing
  • (D) Runtime error

A

Admin • 833.24K Points
Coach

Q. What will be printed?

Code:
int x = 1;
if(x == 1)
    Console.WriteLine("A");
Console.WriteLine("B");
  • (A) A
  • (B) B
  • (C) A B
  • (D) Nothing

A

Admin • 833.24K Points
Coach

Q. Which component is responsible for memory management in .NET?

  • (A) JIT Compiler
  • (B) CLR
  • (C) Garbage Collector
  • (D) Thread Scheduler

A

Admin • 833.24K Points
Coach

Q. What will be the output of the code?

Code:
int a = 5;
int b = a;
b = 10;
Console.WriteLine(a);
  • (A) 5
  • (B) 10
  • (C) 0
  • (D) Compilation error

A

Admin • 833.24K Points
Coach

Q. What will be the output?

Code:
string s = null;
Console.WriteLine(s ?? "Default");
  • (A) null
  • (B) Default
  • (C) Empty string
  • (D) Runtime error

A

Admin • 833.24K Points
Coach

Q. What will be the output?

Code:
var nums = new int[]{1,2,3,4};
var sum = nums.Where(x => x > 2).Sum();
Console.WriteLine(sum);
  • (A) 3
  • (B) 4
  • (C) 7
  • (D) 10

A

Admin • 833.24K Points
Coach

Q. Which access modifier allows access within the same assembly?

  • (A) public
  • (B) private
  • (C) protected
  • (D) internal

A

Admin • 833.24K Points
Coach

Q. What will be printed?

Code:
int x = 10;
Console.WriteLine(x > 5 ? "Yes" : "No");
  • (A) Yes
  • (B) No
  • (C) True
  • (D) False

A

Admin • 833.24K Points
Coach

Q. Which method is used to save changes in Entity Framework Core?

  • (A) Commit()
  • (B) Save()
  • (C) SaveChanges()
  • (D) Flush()

A

Admin • 833.24K Points
Coach

Q. Which HTTP method is used to fetch data?

  • (A) POST
  • (B) PUT
  • (C) GET
  • (D) DELETE

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