MCQ Bank
C++ offers ____________ levels of data access control inside a class
- A) five
- B) three
- C) four
- D) two
new operator can be used for ______________.
- A) only char and integer data types
- B) only integer data type
- C) integer , float, char and double data types
- D) dot operator
Consider the following code, the printed value will be converted into:
int n=10;
cout<<oct<<n;
- A) Base 8
- B) Base 10
- C) Decimal number system
- D) Base 2
What is meaning of bad bit in I/O operation:
- A) Wrong data
- B) Error in data
- C) Bad data
- D) Lost data
Functions declared with the _________________ specifier in a class member list are called friend functions of that class.
- A) public
- B) friend
- C) private
- D) protected
What will be the output of following statement? cout << setfill(‘0’) << setw(7) << 128 ;
- A) 0000128
- B) 0128128
- C) 1280000
- D) 0012800
Friend function declaration can go ___________________ the class
- A) only outside
- B) anywhere in
- C) in the member function of
- D) only within
If we have a program that writes the output data(numbers) to the disc ,and if we collect the output data and write it on the disc in one write operation instead of writing the numbers one by one. In the above situation the area where we will gather the number is called
- A) Cache
- B) Heap
- C) Buffer
- D) Stack
What will be the output of the following code segment? int n=8; cout<<oct<<n;
- A) 8
- B) 10
- C) 1000
- D) 11
Let suppose int a, b, c, d, e; a = b = c = d = e = 42; This can be interpreted by the complier as
- A) a = (b = (c = (d = (e = 42))));
- B) (a = b = (c = (d = (e = 42))));
- C) a = b = (c = (d = (e = 42)));
- D) (a = b) = (c = d) = (e = 42);
A class is _____________.
- A) a built in function
- B) a user defined data type
- C) a member function
- D) an array
public or private keywords can be ______________
- A) written only twice in the class declaration
- B) written only for once in the class or structure declaration
- C) written multiple times in the class or structure declaration
- D) written outside the class
Consider the following code segment. Which of the following will be called while executing code at line 2? String s1 , s2; s1 = s2 ;
- A) Assignment operator
- B) Copy constructor
- C) Default constructor
- D) Parameterized constructor
In a regular expression, what does \d represent?
- A) Any digit (0–9)
- B) A whitespace character
- C) Any letter
- D) A special symbol
In JQuery, innerHeight() method returns:
- A) height of an element excluding padding
- B) height of an element excluding border
- C) height of an element including padding
- D) height of an element including border
The children() method selects:
- A) Direct child elements only
- B) Parent elements
- C) Sibling elements
- D) All elements in DOM
Which part of a variable is hoisted in JavaScript?
- A) Declaration (variable name)
- B) Assignment (value storage)
- C) Initialization (assigning value)
- D) Expression
In DOM tree, an ancestor can be ___________.
- A) Child, grand-child, great grand-child and so on.
- B) All of the given options
- C) Parent, grand parent, great grand-parent and so on.
- D) Siblings
What does points.sort(function(a,b){return a-b}) do?
- A) Sorts the array randomly
- B) Sorts the array alphabetically
- C) Sorts the array in ascending numeric order
- D) Sorts the array in descending order
______________________ is used to Insert content at the beginning of the selected elements.
- A) After()
- B) Prepend()
- C) Before()
- D) Append()