MCQ Bank
________ character is used to terminate a string.
- A)
- B)
- C)
- D)
malloc function returns ___________to the __________________ from the available memory.
- A) integer pointer, middle of the chunk of memory allocated from the heap
- B) NULL pointer, end of the chunk of memory allocated from the stack
- C) void pointer , starting of the chunk of memory allocated from the heap
- D) void pointer, starting of the chunk of memory allocated from the array
which of the following is an example of repetition structure?
- A)
- B)
- C)
- D)
What term describes creating variables from a class?
- A) Object creation
- B) Declaration
- C) Initialization
- D) Implementation
Function declaration is a one-line statement in which we write the return type, ________ of the function and the ________ of arguments
- A)
- B)
- C)
- D)
The exclusive OR operator returns 1 if ______________.
- A) Both inputs are 1
- B) One input is 1 and other is zero
- C) Both inputs are 0
- D) None of the given
Which of the following option gives the value stored at the address pointed to by the pointer "ptr"?
- A)
- B)
- C)
- D)
The ____________ is called automatically when an object destroys
- A) destructor
- B) main program
- C) default constructor
- D) constructor
in C++, cout is known as ________
- A)
- B)
- C)
- D)
To access the data members of structure, _______ is used.
- A) Logical operator
- B) Dereference operator
- C) Dot operator
- D) Address operator
Which of the following is not a file opening mode?
- A)
- B)
- C)
- D)
Initializing the data member within the class is _____________.
- A) a syntax error
- B) a logical error
- C) not an error
- D) a run time error
________ statement is necessary in switch structure.
- A)
- B)
- C)
- D)
Which of the following code segment represents a left shift operator?
- A) result = number >> 1 ;
- B) cin >> number ;
- C) cout<<1;
- D) result = number << 1 ;
Normally, the float data type is half of the size of ________
- A)
- B)
- C)
- D)
Which one of the following is mandatory preprocessor directive for c++?
- A) #undef <iostream>
- B) #include <iostream>
- C) #undef <iostream>
- D) All of the given
which of the following option is used when working with completed expression in c++?
- A)
- B)
- C)
- D)
________________ for parameters is also done for inline functions.
- A) Value checking
- B) Automatic type checking
- C) Syntax checking
- D) Testing
A binary operator has ________ operands.
- A)
- B)
- C)
- D)
What type of memory is used when you allocate memory dynamically in C?
- A) Code Segment
- B) Data Segment
- C) Heap
- D) Stack