GATE-Programming Methodology Questions and Answers

Practice Mode
Showing 10 of 105 questions
Q71
Creating a class definition when one class is granting friendship to a function that is a member of another class requires first
  • A a forward declaration of the class that holds the member function being granted friendship
  • B a forward declaration of the class that is granging friendship
  • C the definition of the class that contains the function that will be friend
  • D the definition of the class that
Answer: Option B
Q72
If my Class is a friend of Your-Class, which is true ?
  • A Your Class is a friend of My Class
  • B Your Class is not a friend of My Class
  • C Yur class may or may not be a friend of My Class
  • D Your Class cannot be a friend of My Class
Answer: Option C
Q73
Forcing a variable type to become another type before accessing an appropriate function is known as
  • A regression
  • B recursion
  • C conversion
  • D coersion
Answer: Option D
Q74
Without overloading of the + operator,
  • A additional could not be performed on built-in types
  • B addition could not be performed on class objects
  • C class objects could not be added to one another
  • D programs would be harder to read and understand.
Answer: Option D
Q75
Which of the following operators may be overloaded ?
  • A .(member)
  • B ::(scope resolution)
  • C %(modulus)
  • D ?:(conditional)
Answer: Option C
Q76
Which of the following may be overloaded as an operator?
  • A operator*()
  • B *operator()
  • C op*()
  • D *op()
Answer: Option D
Q77
The names of the operator function that overloads the * symbol is
  • A operator*()
  • B *operator()
  • C op*()
  • D *op()
Answer: Option A
Q78
Assuming you have properly overloaded the/operator for a Number class, and that a and b are two members of the Number class, which expression is legal?
  • A a/b
  • B a.operator/(b)
  • C both(a) and (b)
  • D none of these
Answer: Option C
Q79
Assuming yu have properly overloaded the *operator to perform multiplication for a Number class, and that a, b, and c are three members of the Number class, which expression is legal?
  • A a*b
  • B a*b*c
  • C both (a) and (b)
  • D none of these
Answer: Option C
Q80
When an operator is used alone with a single variable argument, the operator is said to be
  • A unique
  • B unary
  • C alone
  • D allocated
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test