MCQ Bank
Default scope for members of structures is ________ and default visibility for class members is ________
- A)
- B)
- C)
- D)
The_______is the increment Operator in c++.
- A) *+
- B) ++
- C) - -
- D) +*
If A and B are two matrices of order M*N to be added then their resultant matrix will have an order of
- A)
- B)
- C)
- D)
Which of the following is used to create an output stream?
- A) ofstream
- B) iostream
- C) fsstream
- D) ifstream
if m is a matrix object, then self-assignment can be avoided by using following code statement
- A)
- B)
- C)
- D)
A class is _____________.
- A) a built in function
- B) a member function
- C) an array
- D) a user defined data type
Which of the following is correct format of template function?
- A)
- B)
- C)
- D)
Why is casting a void* necessary after memory allocation in C?
- A) Because void pointers are unsafe
- B) Because C requires explicit type specification for void pointers
- C) Because void* cannot be dereferenced directly
- D) Both B and C
In template class, compiler makes a copy of ________ and convert in to ________
- A)
- B)
- C)
- D)
What is the correct way to define a macro for squaring a number safely?
- A) #define square(x) ((x) * (x))
- B) #define square(x) x ** 2
- C) #define square(x) x * x
- D) #define square(x) (x) * (x)
For a matrix, the variables of Rows and Columns should always be a ________
- A)
- B)
- C)
- D)
The malloc function takes ___________ argument(s).
- A) two
- B) four
- C) one
- D) three
After implementation of code is completed, we do its ________ to verify that it is behaving properly in all scenarios.
- A)
- B)
- C)
- D)
a ^= b; can be written as_________________.
- A) a = b ^ a;
- B) a = a^+b;
- C) a = a ^ b;
- D) a^= a + b;
which three constructs do we need to solve any problem?
- A)
- B)
- C)
- D)
The data, contained in the structure, is defined in the ______________.
- A) none
- B) curly braces
- C) parenthesis
- D) inverted commas
Declaration and definition of a template function should be in the ________ file
- A)
- B)
- C)
- D)
a = a & b; can be written as_____________.
- A) a = b;
- B) a &= b;
- C) a=a & b;
- D) a =& b;
For template function, we must have at least ________ generic argument.
- A)
- B)
- C)
- D)
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