C# Data Types Aptitude Questions and Answers | Set 3

This section contains aptitude questions and answers on C# data types (set 3).

1) What is the range of double in C#?
  1. +-1.5 x 10-45 to +-3.4 x 1038
  2. +-5.0 x 10-324 to +-1.7 x 10308
  3. +-1.0 x 10-28 to +-7.9 x 1028
  4. +-2.0 x 10-28 to +-7.9 x 1028

2) What is the range of float in C#?
  1. +-1.5 x 10-45 to +-3.4 x 1038
  2. +-5.0 x 10-324 to +-1.7 x 10308
  3. +-1.0 x 10-28 to +-7.9 x 1028
  4. +-2.0 x 10-28 to +-7.9 x 1028

3) What is the range of decimal in C#?
  1. +-1.5 x 10-45 to +-3.4 x 1038
  2. +-5.0 x 10-324 to +-1.7 x 10308
  3. +-1.0 x 10-28 to +-7.9 x 1028
  4. +-2.0 x 10-28 to +-7.9 x 1028

4) What is the default value of boolean type in C#?
  1. True
  2. False
  3. -1
  4. 0

5) Value types are occupied space in?
  1. Stack segment
  2. Register segment
  3. Heap segment
  4. None of the above

6) Reference types are occupied space in?
  1. Stack segment
  2. Register segment
  3. Heap segment
  4. None of the above

7) There is a statement is given below which is true or false??
"Every data type available in C#, is either a reference type or value type?"
  1. True
  2. False

8) There is a statement is given below which is true or false?
""In C#, widening conversions happened automatically, there is no need to do widening conversion explicitly.
  1. True
  2. False

9) Which statement is correct about boxing in C#?
  1. Assign an integer value to object type.
  2. Convert Object type value to a value type.
  3. Both of the above
  4. None of the above

10) There are following statements are given below, what are the correct ways to initialize value 5 into A and B integer variables?
  1. int A=5;
    int B=5;
  2. int A,B=5;
  3. int A=5,B=5;
  4. int A=B=5;

Options

  1. A, C
  2. Only A
  3. Only C
  4. Only D

11) There is a statement is given below which is true or false?
"Can we store null value to value types?"
  1. True
  2. False

12) There is a statement is given below which is true or false?
""In C#, in the case of all value types there is an implicit constructor which is used to initialize value type variable by its default value?
  1. True
  2. False





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.