MCQ Bank
The statement double** elements; says that elements is a / an ________ to double.
- A)
- B)
- C)
- D)
The heap memory structure __________.
- A) constantly changes in size
- B) contains no space
- C) remains constant
- D) is just like stack
A matrix is nothing but a ________ of numbers.
- A)
- B)
- C)
- D)
When accessing a structure member, the identifier to the left of the dot operator is the name of ______________.
- A) Structure member
- B) Structure data
- C) Structure variable
- D) Structure tag
A programmer can ________ the simple matrix class to handle the integer, float, or double data type as elements of the given matrix.
- A)
- B)
- C)
- D)
What will be the output of the following c++ code?
#include<iostream.h>
#define max 100
main()
{
#ifdef max
Cout<<”Hellow;
}
- A) Error
- B) Hello
- C) “Hellow”
- D) Max is 100
in C and C++ language, every expression has a ________ of its own?
- A)
- B)
- C)
- D)
In shifting operations if zero is inserted at the left most bit, the negative number will become a ______ number.
- A) Greater
- B) Negative
- C) Positive
- D) Smaller
The cycle of testing and ________ continues until the program is working perfectly without any problem.
- A)
- B)
- C)
- D)
_______________function gives the position of the next character to be read from that file.
- A) tellp()
- B) tellg()
- C) seekg()
- D) seekp()
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)