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 1

C++ Constants & Data Types | Set 1

1. The constants are also called as

a) Const
b) preprocessor
c) literals
d) none of these

2. What are the parts of the literal constants?

a) integer numerals
b) floating-point numerals
c) strings and boolean values
d) all of the mentioned

3. What is the size of wchar_t in C++?

a) 2
b) 4
c) 2 or 4
d) Based on the number of bits in the system

4. Pick the odd one out.

a) array type
b) character type
c) boolean type
d) integer type

5. Which data type is used to represent the absence of parameters?

a) int
b) short
c) void
d) float

6. What does ‘\a’ escape code represent?

a) alert
b) backslash
c) tab
d) form feed

7. How the constants are declared?

a) const keyword
b) #define preprocessor
c) both a and b
d) None of these

8. Which type is best suited to represent the logical values?

a) integer
b) boolean
c) character
d) float

9. Identify the user-defined types from the following?

a) enumeration
b) classes
c) both enumeration and classes
d) int

10. Which of the following statements are true?
int f (float)

a) f is a function taking an argument of type int and returning a floating point number
b) f is a function taking an argument of type float and returning an integer
c) f is a function of type float
d) f is a function of type int

- Related Topics