C++ MCQ Questions - Data Type
This section focuses on the "Data Type" in C++ programming langauge. These Multiple Choice Questions (MCQ) should be practiced to improve the C++ programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. Keyword of Floating point is?
A. double
B. float
C. char
D. floating
View Answer
Ans : B
Explanation: Keyword of Floating point is float
2. Typical bit width of char is?
A. 0 byte
B. 1byte
C. 2byte
D. 3byte
View Answer
Ans : B
Explanation: Typical bit width of char is 1 byte
3. Typical range of unsigned int?
A. -127 to 127
B. 0 to 65,535
C. 0 to 4294967295
D. -2,147,483,648 to 2,147,483,647
View Answer
Ans : C
Explanation: Typical range of unsigned int is 0 to 4294967295
4. Which type has typical bit width 12 bytes?
A. float
B. double
C. long double
D. unsigned long long int
View Answer
Ans : C
Explanation: long double has typical bit width 12 bytes
5. We can create a new name for an existing type using?
A. type
B. tdef
C. wtype
D. typedef
View Answer
Ans : D
Explanation: We can create a new name for an existing type using typedef.
6. Each enumerator is a constant whose type is the enumeration.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Each enumerator is a constant whose type is the enumeration.
7. Keyword of Wide character is?
A. wchar
B. char
C. double
D. wchar_t
View Answer
Ans : D
Explanation: Keyword of Wide character is wchar_t
8. signed long int typical range equal to?
A. signed short int
B. unsigned short int
C. long int
D. double
View Answer
Ans : C
Explanation: same as long int
9. By default, the value of the first name in enum data type is?
A. 0
B. 1
C. 2
D. 3
View Answer
Ans : A
Explanation: By default, the value of the first name is 0, the second name has the value 1, and the third has the value 2, and so on.
10. We are also using sizeof() operator to get size of various data types.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, We are also using sizeof() operator to get size of various data types.
Discussion