MCQ Bank
which of the following is true about the switch statement?
- A)
- B)
- C)
- D)
What does the calloc function return if it fails to allocate memory?
- A) 0
- B) -1
- C) NULL
- D) It crashes the program
If the condition is not made false in while loop, what will happen?
- A)
- B)
- C)
- D)
Which is the correct syntax to define a structure named ‘student’?
- A) struct student{ //variables };
- B) struct student( //variables );
- C) structure student( //variables );
- D) structure student{ //variables };
If a function does not return anything, its return type will be ________
- A)
- B)
- C)
- D)
A file opened with ________________ is used for input and cannot be used for output.
- A) ifstream
- B) conio
- C) ofstream
- D) iostream
which of the following is the first step in FOR loop?
- A)
- B)
- C)
- D)
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
When we call a function and pass an argument, an object or variable to the function, it is called ?
- A)
- B)
- C)
- D)
the sizeof operator is used to determine the size of _____________.
- A) data
- B) None of the given
- C) data type
- D) variable
Stream insertion (<<) and extraction operators (>>) are always implemented as ________ function.
- A)
- B)
- C)
- D)
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
which of the following statement is not true about overloading stream extraction operator (>>)?
- A)
- B)
- C)
- D)
Object code is machine code but it is not _____________ and ___________.
- A) compiled ,debugged
- B) relocatable , executable
- C) tested , compiled
- D) faster , efficient
endl is a type of ________ manipulator.
- A)
- B)
- C)
- D)
__________________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