Loading...

C++ Multiple Choice Questions

Our C++ questions and answers focuses on all areas of C++ programming language covering 100+ topics in C++

C++ Constants & Data Types MCQ | Set 2

C++ Constants & Data Types | Set 2


11. The value 132.54 can be represented using which data type?

a) double
b) void
c) int
d) bool



12. When a language has the capability to produce new data type mean, it can be called as

a) overloaded
b) extensible
c) encapsulated
d) reprehensible



13. Pick the odd one out.

a) integer, character, boolean, floating
b) enumeration, classes
c) integer, enum, void
d) arrays, pointer, classes



14. How many characters are specified in the ASCII scheme?

a) 64
b) 128
c) 256
d) 24



15. Given the variables p, q are of char type and r, s, t are of int type. Select the right statement?
1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);

a) 1 is true but 2 is false
b) 1 is false and 2 is true
c) both 1 and 2 are true
d) both 1 and 2 are false



16. Which of the following belongs to the set of character types?

a) char
b) wchar_t
c) only a
d) both wchar_t and char



17. How do we represent a wide character of the form wchar_t?

a) L’a’
b) l’a’
c) L[a]
d) la



18. In C++, what is the sign of character data type by default?

a) Signed
b) Unsigned
c) Implementation dependent
d) Unsigned Implementation



19. Is the size of character literals different in C and C++?

a) Implementation defined
b) Can’t say
c) Yes, they are different
d) No, they are not different



20. Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?

a) 4
b) 1
c) Implementation dependent
d) Machine dependent



- Related Topics