Govt. Exams
Entrance Exams
Auto-implemented properties in C# use the syntax: public Type PropertyName { get; set; } without explicitly defining the backing field.
Arrays in C# are automatically initialized with default values. For int arrays, the default value is 0. Therefore, the output will be five zeros separated by spaces.
Dictionary<K, V> stores key-value pairs and ensures unique keys. List stores ordered values, HashSet stores unique values only, Queue is FIFO.
Since both 10 and 3 are integers, integer division occurs, resulting in 3 (the decimal part is truncated).
Option A is the correct C# syntax. Option B is C-style, Option C has wrong syntax, and Option D has incorrect keyword placement.
string is a reference type in C#, while int, float, and bool are value types.
The && operator requires both conditions to be true. (5 > 3) is true, but (3 < 2) is false. Since one condition is false, the entire expression evaluates to false.
Value types (int, double, struct, etc.) are stored on the stack memory. Reference types (class, interface) are stored on the heap. Value types don't require null checks like reference types.
The default access modifier for class members in C# is 'private'. This means the member is only accessible within the same class unless explicitly specified otherwise.
The 'const' keyword declares a constant whose value cannot be modified. Both 'const' and 'readonly' prevent changes, but 'const' is compile-time constant while 'readonly' is runtime constant.