C# - Datatypes Questions and Answers
Practice ModeShowing 10 of 42 questions
Q31
What is the size of double data type in C#?
Answer: Option C
Explanation: Double occupies 8 bytes in memory.
Q32
Which data type is used to store a sequence of characters?
Answer: Option B
Explanation: String stores a sequence of characters.
Q33
Which of the following is a nullable value type?
Answer: Option B
Explanation: Nullable value types are declared using ?.
Q34
Which data type can store both value types and reference types?
Answer: Option C
Explanation: Object can store any data type in C#.
Q35
What is the default value of a bool variable?
Answer: Option B
Explanation: Default value of bool is false.
Q36
Which data type is best suited for memory optimization when storing small numbers?
Answer: Option C
Explanation: Byte uses only 1 byte of memory.
Q37
Which data type represents signed 16-bit integers?
Answer: Option A
Explanation: Short is a signed 16-bit integer type.
Q38
Which of the following is an unsigned data type?
Answer: Option C
Explanation: Uint represents an unsigned integer.
Q39
Which data type should be used to store date and time in C#?
Answer: Option B
Explanation: DateTime is used to store date and time values.
Q40
Which data type stores true, false, or null values?
Answer: Option C
Explanation: Nullable bool can store true, false, or null.