MCQ Bank
a = a & b; can be written as_____________.
- A) a = b;
- B) a &= b;
- C) a=a & b;
- D) a =& b;
How is #include “filename” different from #include <filename>?
- A) It includes binary files only
- B) It uses a different syntax with no functional difference
- C) It includes only header files with .cpp extension
- D) It searches the current directory first
The function overloading requires__________________.
- A) the argument list to be different.
- B) no arguments
- C) the arguments of integer type only
- D) the argument list to be the same
What is encapsulation in the context of classes?
- A) Grouping unrelated data
- B) Hiding data implementation details
- C) Making everything public
- D) Grouping functions only
Multiplicatiive, Additive and assignment operators are ____ operators.
- A) Unary
- B) Conditional
- C) Binary
- D) Relational
Constructor is special type of function :
- A) which returns integer type data
- B) which returns NULL pointer
- C) which has no return type
- D) which returns zero
Which one is the correct example of a unary operator?
- A) /
- B) -
- C) &
- D) ==
These functions seekg() and seekp() requires an argument of type ____________to determine that how many bytes to be move forward or backward.
- A) short
- B) long
- C) double
- D) int
A structure is a collection of _____________under a single name.
- A) None of the given
- B) values
- C) data
- D) variables
_______ is the pointer which determines the position in a file from where the next read operation occurs.
- A) Tell
- B) Set
- C) Get
- D) Put
We have opened a file stream myfile for reading (getting), myfile.tellg () gives us the current get position of the file pointer. It returns a whole number of type___________
- A) short
- B) int
- C) long
- D) double
_________ is a special type of pointer we have to cast it before we use it.
- A) integer
- B) void
- C) double
- D) float
Which of the following is NOT a valid preprocessor directive?
- A) #ifdef
- B) #pragma
- C) #define
- D) #function
The object code of our program is combined with the _______________.
- A) source program
- B) with header files
- C) machine code of the operating system
- D) object code of the library functions
Once we have defined a symbolic constant value using #define, that value _________during program execution.
- A) becomes zero
- B) cannot be changed
- C) can be changed
- D) varies
The data members of the class are initialized ______________.
- A) at runtime
- B) within main program
- C) outside the function
- D) at compile time
How many bits form a byte?
- A) 8
- B) 4
- C) 2
- D) 6
Macros are categorized into _________ type(s).
- A) two
- B) one
- C) three
- D) four
Bugs can occur due to ____________________
- A) initialization of a variable
- B) object destruction
- C) uninitialized data
- D) default values
__________ allow us to have a memory location and use it as int or char interchangeably
- A) union
- B) None of the given
- C) construct
- D) structures