A

Admin • 828.03K Points
Coach

Q. What will be the output?

Code:
List<int> list = new List<int>{1,2,3};
list.Add(4);
Console.WriteLine(list.Count);
  • (A) 3
  • (B) 4
  • (C) 5
  • (D) Compilation error

Explanation by: Admin
Add() inserts an element and Count returns total elements.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.