Sail E0 Webinar

MCQs

Total Questions : 76 | Page 7 of 8 pages
Question 61.

An array element is accessed using


  1.    a FIFO approach
  2.    an index number
  3.    the operator
  4.    a member name
 Discuss Question
Answer: Option B. -> an index number


Question 62.

If x = 5, y = 2 then x ^ y equals________.
(where ^ is a bitwise XOR operator)


  1.    00000111
  2.    10000010
  3.    10100000
  4.    11001000
 Discuss Question
Answer: Option A. -> 00000111


Question 63.

A property which is not true for classes is that they


  1.    are removed from memory when not in use.
  2.    permit data to be hidden from other classes.
  3.    bring together all aspects of an entity in one place.
  4.    Can closely model objects in the real world.
 Discuss Question
Answer: Option C. -> bring together all aspects of an entity in one place.



Question 64.

What is the error in the following code?
class t
{
virtual void print();
}


  1.    No error.
  2.    Function print() should be declared as static.
  3.    Function print() should be defined.
  4.    Class t should contain data members.
 Discuss Question
Answer: Option A. -> No error.


Question 65.

If you wanted to sort many large objects or structures, it would be most efficient to


  1.    place them in an array & sort the array.
  2.    place pointers to them in an array & sort the array.
  3.    place them in a linked list and sort the linked list.
  4.    place references to them in an array and sort the array.
 Discuss Question
Answer: Option C. -> place them in a linked list and sort the linked list.



Question 66.

What would be the output of the following program?
int main()
{
int x,y=10,z=10;
x = (y = =z);
cout<<x;
return 0;
}


  1.    1
  2.    0
  3.    10
  4.    Error
 Discuss Question
Answer: Option A. -> 1


Question 67.

Which of the following declarations are illegal?


  1.    void *ptr;
  2.    char *str = “hello”;
  3.    char str = “hello”;
  4.    const *int p1;
 Discuss Question
Answer: Option C. -> char str = “hello”;



Question 68.

The process of building new classes from existing one is called


  1.    Structure.
  2.    Inheritance.
  3.    Polymorphism
  4.    Template
 Discuss Question
Answer: Option B. -> Inheritance.



Question 69.

The following can be declared as friend in a class


  1.    an object
  2.    a class
  3.    a public data member
  4.    a private data member
 Discuss Question
Answer: Option B. -> a class



Question 70.

Overloading a postfix increment operator by means of a member function takes


  1.    no argument
  2.    one arument
  3.    two arguments
  4.    three arguments
 Discuss Question
Answer: Option A. -> no argument


Latest Videos

Latest Test Papers