MCQ Bank
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)
In C++, which of the following option is used to declare a class?
- A) class
- B)
- C)
- D)
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) Inline function
- B)
- C)
- D)
Bool data type takes ________ values.
- A) 2
- B)
- C)
- D)
In the syntax of the overloaded operator function given below: Complex operator + (Complex &); What is operator?
- A) keyword
- B)
- C)
- D)