MCQ Bank
The compiler use a name mangling technique to _______________________.
- A) Run the functions
- B) Generate a unique token that is assigned to each function
- C) Generate unique functions
- D) Compile the functions
the sizeof operator is used to determine the size of _____________.
- A) data
- B) None of the given
- C) data type
- D) variable
The main advantage of function overloading is that ____________.
- A) The program becomes complex
- B) The program becomes portable
- C) The function becomes inline
- D) The program becomes more readable
Object code is machine code but it is not _____________ and ___________.
- A) compiled ,debugged
- B) relocatable , executable
- C) tested , compiled
- D) faster , efficient
__________________function is used to determine the next position to write a character while writing into a file.
- A) tellp()
- B) seekg()
- C) tellg()
- D) seekp()
In_____________, we have different data members and all of these have their own memory space.
- A) None of the given
- B) union
- C) construct
- D) structures
When is a destructor automatically called?
- A) When an object is created
- B) Only when explicitly called
- C) When a program starts
- D) When an object goes out of scope or is deleted
The function calloc takes two arguments, first argument is the ______________ and the second argument is the ____________.
- A) size of space, number of bytes
- B) space in terms of string character, size of list
- C) size of array , number of bytes
- D) required space in terms of numbers , size of space
The main advantage of function overloading is that ____________.
- A) The program becomes complex
- B) The function becomes inline
- C) The program becomes portable
- D) The program becomes more readable
Which is the correct syntax to define a structure named ‘student’?
- A) struct student{ //variables };
- B) structure student( //variables );
- C) struct student( //variables );
- D) structure student{ //variables };
The ____________ is called automatically when an object destroys
- A) default constructor
- B) constructor
- C) main program
- D) destructor
The function calloc takes two arguments, first argument is the ______________ and the second argument is the ____________.
- A) size of space, number of bytes
- B) size of array , number of bytes
- C) space in terms of string character, size of list
- D) required space in terms of numbers , size of space
Which of the following code segment represents a left shift operator?
- A) result = number << 1 ;
- B) result = number >> 1 ;
- C) cout<<1;
- D) cin >> number ;
Once we have defined a symbolic constant value using #define, that value _________during program execution.
- A) varies
- B) becomes zero
- C) cannot be changed
- D) can be changed
a ^= b; can be written as_________________.
- A) a = b ^ a;
- B) a = a^+b;
- C) a^= a + b;
- D) a = a ^ b;
Which one of the following is used to perform bit-wise exclusive OR operation?
- A) ||
- B) |
- C) ~
- D) ^
__________________function is used to determine the next position to write a character while writing into a file.
- A) seekg()
- B) tellg()
- C) seekp()
- D) tellp()
What is the main difference between a struct and a class in C++?
- A) Classes don’t allow data grouping.
- B) Structs can’t have functions.
- C) There is no difference.
- D) Struct members are public by default; class members are private.
In a class we can have ___________ constructor(s).
- A) two
- B) many
- C) only one
- D) no
What is the storage space of double data type?
- A) 8 bytes
- B) 16 bytes
- C) 64 bytes
- D) 32 bytes