MCQ Bank
Which of the following is not a file opening mode?
- A)
- B)
- C)
- D)
Initializing the data member within the class is _____________.
- A) a syntax error
- B) a logical error
- C) not an error
- D) a run time error
________ statement is necessary in switch structure.
- A)
- B)
- C)
- D)
Which of the following code segment represents a left shift operator?
- A) result = number >> 1 ;
- B) cin >> number ;
- C) cout<<1;
- D) result = number << 1 ;
Normally, the float data type is half of the size of ________
- A)
- B)
- C)
- D)
Which one of the following is mandatory preprocessor directive for c++?
- A) #undef <iostream>
- B) #include <iostream>
- C) #undef <iostream>
- D) All of the given
which of the following option is used when working with completed expression in c++?
- A)
- B)
- C)
- D)
________________ for parameters is also done for inline functions.
- A) Value checking
- B) Automatic type checking
- C) Syntax checking
- D) Testing
A binary operator has ________ operands.
- A)
- B)
- C)
- D)
What type of memory is used when you allocate memory dynamically in C?
- A) Code Segment
- B) Data Segment
- C) Heap
- D) Stack
which of the following is the default function calling mechanism of C/C++?
- A)
- B)
- C)
- D)
In a class we can have ___________ constructor(s).
- A) no
- B) two
- C) only one
- D) many
which function is automatically called when an object of a class is initialized?
- A)
- B)
- C)
- D)
Which of the following memory allocation types occurs at compile-time?
- A) Runtime Allocation
- B) Static Memory Allocation
- C) Heap Allocation
- D) Dynamic Memory Allocation
In C++, which of the following option is used to declare a class?
- A)
- B)
- C)
- D)
Array indexes start from __________.
- A) 2
- B) 1
- C) 0
- D) 3
in C++ which of the following function causes the full definition of the function to be inserted in each place when it gets called?
- A)
- B)
- C)
- D)
We use dot operator to access the data members of both ___________ and ____________.
- A) none of them
- B) arrays, structures
- C) unions, structures
- D) unions, arrays
Bool data type takes ________ values.
- A)
- B)
- C)
- D)
Sometimes after allocating memory we need additional space, for this purpose we use ______________.
- A) realloc function
- B) reallocation function
- C) calloc function
- D) void pointer