C# - Datatypes Questions and Answers
Practice ModeShowing 10 of 42 questions
Q1
Which of the following statements are correct about data types?
If the integer literal exceeds the range of byte, a compilation error will occur.
We cannot implicitly convert non-literal numeric types of larger storage size to byte.
Byte cannot be implicitly converted to float.
A char can be implicitly converted to only int data type.
We can cast the integral character codes.
Answer: Option D
Q2
Which of the following is an 8-byte Integer?
Answer: Option B
Q3
Which of the following is NOT an Integer?
Answer: Option A
Q4
Which of the following statements is correct?
Answer: Option C
Q5
Which of the following are value types?
Integer
Array
Single
String
Long
Answer: Option B
Q6
Which of the following does not store a sign?
Answer: Option D
Q7
What is the size of a Decimal?
Answer: Option C
Q8
What will be the output of the following code snippet when it is executed?
int x = 1;
floaty = 1.1f;
short z = 1;
Console.Write.Line((float) x + y * z - (x += (short) y));
Answer: Option A
Q9
Which of the following statements is correct about the C#.NET code snippet given below?
short s1 = 20;
short s2 = 400;
int a;
a = s1 * s2;
Answer: Option A
Q10
Which of the following is the correct size of a Decimal datatype?
Answer: Option D