[MCQ] C++ Topic Wise MCQ | Topic - C++ Types | IJNO

Question : 01

What is the size of wchar_t in C++?
2
4
2 or 4
Based on the number of bits in the system
Answer: d
Explanation:
Compiler wants to make CPU as more efficient in accessing the next value.

Question : 02

Pick the odd one out.
integer, character, boolean, floating
enumeration, classes
integer, enum, void
arrays, pointer, classes
Answer: c
Explanation:
integer, character, boolean & floating consists of all fundamental types, enumeration & classes consists of user-defined types and arrays, pointer & classes consists of derived types but integer, enum & void is a mixture.

Question : 03

Pick the odd one out.
array type
character type
boolean type
integer type
Answer: a
Explanation:
Array type is not the basic type and it is constructed using the basic type.

Question : 04

When a language has the capability to produce new data type mean, it can be called as
overloaded
extensible
encapsulated
reprehensible
Answer: b
Explanation:
Extensible is used to add new features to C++.

Question : 05

Which data type is used to represent the absence of parameters?
int
short
void
float
Answer: c
Explanation:
Because void specifies an empty set of values/parameters.

Question : 06

The value 132.54 can be represented using which data type?
double
void
int
bool
Answer: a
Explanation:
The given value is with decimal points, so float or double can be used.

Question : 07

What does ‘\a’ escape code represent?
alert
backslash
tab
form feed
Answer: a
Explanation:
Because \a is used to produce a beep sound.

Question : 08

Which of the following statements are true?
int f(float)
f is a function taking an argument of type int and returning a floating point number
f is a function taking an argument of type float and returning an integer
f is a function of type float
f is a function of type int
Answer: b Explanation: The argument that is passed to a function f is of float type and the function finally returns a value that id is of integer type.

Question : 09

Which type is best suited to represent the logical values?
integer
boolean
character
float
Answer: b
Explanation:
Logical values can be either true or false, so the boolean type is suited for it.

Question : 10

Identify the user-defined types from the following?
enumeration
classes
both enumeration and classes
int
Answer: c
Explanation:
They must be defined by the users before use, unlike the other types which are readily available.

Post a Comment

Previous Post Next Post

Advertisement

Advertisement