MCQ Bank
Macro is defined by ________ preprocessor directive.
- A)
- B)
- C)
- D)
Macros are categorized into _________ type(s).
- A) two
- B) one
- C) three
- D) four
In C++, when accessing files randomly, which function is used to get current pointer position inside a file?
- A)
- B)
- C)
- D)
Bugs can occur due to ____________________
- A) initialization of a variable
- B) object destruction
- C) uninitialized data
- D) default values
Which is not a preprocessor directive of C-Language?
- A)
- B)
- C)
- D)
__________ allow us to have a memory location and use it as int or char interchangeably
- A) union
- B) None of the given
- C) construct
- D) structures
The statement char arr[10]; is an example of a type of ________ memory allocation
- A)
- B)
- C)
- D)
Shifting the binary numbers is similar to shifting the _____ numbers.
- A) Base 7
- B) Decimal
- C) Octal
- D) Hexadecimal
What would be the output of the following statement? C=13%2;
- A)
- B)
- C)
- D)
a = a|b; ca be written as________________.
- A) a |=b;
- B) a=b;
- C) a =|b;
- D) a ==b;
Which of the following two array are copy-able?
- A)
- B)
- C)
- D)
What is the storage space of double data type?
- A) 64 bytes
- B) 32 bytes
- C) 16 bytes
- D) 8 bytes
A variable declared inside a code block becomes the ________ variable for that block.
- A)
- B)
- C)
- D)
For casting, we normally declare a pointer of type _____________.
- A) integer
- B) NULL
- C) void
- D) we are going to use
Which type of arrays are used while dealing with sentences?
- A)
- B)
- C)
- D)
What is the primary purpose of a class in C++?
- A) To define a user-defined data type with data members and methods
- B) To execute standalone functions
- C) To store only data without any functions
- D) To replace all global variables in a program
In the call by reference method, which operator is used to get the address of a variable?
- A)
- B)
- C)
- D)
Which one of the following is used to perform bit-wise OR operation?
- A) |
- B) ||
- C) ~
- D) ^
Which of the following is the correct method to declare an array?
- A)
- B)
- C)
- D)
Programmer should be very careful about the memory management because it can _____________.
- A) create problems of NULL pointers
- B) cause problems of memory leakage and dangling pointers
- C) return void pointers
- D) affect the logic of the program