MCQ Bank
in C++ sizeof operator is used to determine ________
- A)
- B)
- C)
- D)
What allows an object to interact with private data members of a class?
- A) Inheritance
- B) Pointers
- C) Global variables
- D) Public member functions
which of the following header file deals with stream extraction?
- A)
- B)
- C)
- D)
Public member functions of the class ______________main program.
- A) are accessible in
- B) are not accessible in
- C) are private to
- D) are defined within the
Type to use getch() function without including #include<conio.h> header file in the program is a ________ error
- A)
- B)
- C)
- D)
Destructor _______________________.
- A) takes no arguments and can be overloaded
- B) cannot be overloaded and have return type
- C) can be overloaded and have return type
- D) cannot be overloaded and have no return type
in C++ the default constructor takes ________
- A)
- B)
- C)
- D)
We cannot use ______________ pointer for storing and reading data from it.
- A) double
- B) NULL
- C) integer
- D) zero
in C++ the name of the ________ is the same as that of a class with a preceding tilde (~) sign.
- A)
- B)
- C)
- D)
Which of the following is the default mode of the file opening while using the ofstream class?
- A) ios::trunc
- B) ios::app
- C) ios::out
- D) ios::in
which of the following option returns the state of end file?
- A)
- B)
- C)
- D)
What is the default access level for members of a class in C++?
- A) global
- B) protected
- C) private
- D) public
If the memory in the free store is not sufficient enough to fulfill the request, malloc() function return ________
- A)
- B)
- C)
- D)
An integer uses four bytes and the integer calculations occur in ______ bytes.
- A) 8
- B) 3
- C) 4
- D) 2
in C/C++ language, memory at runtime is allocated from ________
- A)
- B)
- C)
- D)
Which one of the following is used to perform bit-wise exclusive OR operation?
- A) |
- B) ||
- C) ^
- D) ~
When overloading assignment (=) operator, which of the following syntax is correct?
- A)
- B)
- C)
- D)
Which of the following is not a file opening mode_________________?
- A) ios::ate
- B) ios::out
- C) ios::in
- D) ios::truncate
which of the following code:
- A)
- B)
- C)
- D)
What is the use of ios::trunc mode?
- A) To open a file in output mode
- B) To truncate an existing file to half
- C) To truncate an existing file to zero
- D) To open a file in input mode