MCQ Bank
Which type of arrays are used while dealing with sentences?
- A) Character arrays
- B)
- C)
- D)
In the call by reference method, which operator is used to get the address of a variable?
- A) &
- B)
- C)
- D)
Which of the following is the correct method to declare an array?
- A) data-type array-name[size];
- B)
- C)
- D)
char name[] = "Hello World"; In the above statement, a memory of ________ characters will be allocated to the array name.
- A) 12
- B)
- C)
- D)
In C++, what is the correct syntax for accessing the fifth element of an array?
- A) a[4]
- B)
- C)
- D)
Which of the following shows the memory address of the first element in an array?
- A) array[0]
- B)
- C)
- D)
In C++, the precise way to declare a pointer is,
- A) int *ptr;
- B)
- C)
- D)
Identify the invalid option.
- A) int *pi=0;
- B)
- C)
- D)
________ character is used to terminate a string.
- A) Null
- B)
- C)
- D)
which of the following is an example of repetition structure?
- A) while
- B)
- C)
- D)
Function declaration is a one-line statement in which we write the return type, ________ of the function and the ________ of arguments
- A) Name, Data type
- B)
- C)
- D)
Which of the following option gives the value stored at the address pointed to by the pointer "ptr"?
- A) *ptr
- B)
- C)
- D)
in C++, cout is known as ________
- A) output stream
- B)
- C)
- D)
Which of the following is not a file opening mode?
- A) ios::trunk
- B)
- C)
- D)
________ statement is necessary in switch structure.
- A) Break
- B)
- C)
- D)
Normally, the float data type is half of the size of ________
- A) Double
- B)
- C)
- D)
which of the following option is used when working with completed expression in c++?
- A) ()
- B)
- C)
- D)
A binary operator has ________ operands.
- A) Two
- B)
- C)
- D)
which of the following is the default function calling mechanism of C/C++?
- A) Call by value
- B)
- C)
- D)
which function is automatically called when an object of a class is initialized?
- A) constructor
- B)
- C)
- D)