MCQ Bank
What is a correct expression for finding factorial where f = 1 , i=1;
While (i<=n)?
- A) F=f*n
- B) F=f2n
- C) F=f-n
- D) F=f+n
Which of the following symbol is used to represent Boolean operator for logical AND?
- A) ||
- B) &|
- C) &&
- D) !&
A----------- alters the execution sequence of the program
- A) Control statement
- B) Assignment statement
- C) Modulus
- D) Division
How is the illusion of parallel processing achieved when only one CPU is available?
- A) Each activation is assigned to a separate CPU core
- B) Activations share the time of the single processor
- C) Animations are executed in a sequential manner
- D) Multiprogramming systems are employed
Which one is not a valid data type?
- A) Int
- B) Char
- C) Float
- D) Html
What does the imperative paradigm, also known as the procedural paradigm, represent in the programming process?
- A) Traditional approach to programming
- B) Functional programming approach
- C) Object-oriented approach
- D) Linear scale development
Name the function whose definition can be substituted at a place where its function call is made _________.
- A) friend function
- B) inline function
- C) volatile function
- D) static function
Which is not true regarding structures?
- A) d) Both b & c
- B) b) We can take the size of structure
- C) c) We can’t declare pointers to structure
- D) a) We can declare arrays of structure
By writing aFile.seekg(15L, ios::cur) we are moving ______________.
- A) 15 bits in the backward direction starting from the current position
- B) 15 bytes in the forward direction starting from the current position
- C) 15 bits in the backward direction starting from the previous position
- D) 15 bytes in the backward direction starting from the current position
Default constructor generated by ______________does ______________for us.
- A) main program, memory management
- B) compiler, no initialization
- C) classes , initialization
- D) compiler , initialization
The dynamic memory allocation uses ___________ whereas static memory allocation uses _________.
- A) classes , array
- B) array , stack
- C) stack , lists
- D) heap , stack
What is the main purpose of the C preprocessor?
- A) Translate object code into machine code
- B) Execute the program
- C) Enhance the C language by preprocessing code before compilation
- D) Optimize the executable file
What allows an object to interact with private data members of a class?
- A) Inheritance
- B) Pointers
- C) Global variables
- D) Public member functions
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
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
We cannot use ______________ pointer for storing and reading data from it.
- A) double
- B) NULL
- C) integer
- D) zero
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
What is the default access level for members of a class in C++?
- A) global
- B) protected
- C) private
- D) public
An integer uses four bytes and the integer calculations occur in ______ bytes.
- A) 8
- B) 3
- C) 4
- D) 2
Which one of the following is used to perform bit-wise exclusive OR operation?
- A) |
- B) ||
- C) ^
- D) ~