GATE-Programming Methodology Questions and Answers
Programming methodology in C++ focuses on structured and object-oriented approaches to problem-solving using efficient algorithms and modular coding. For GATE aspirants and placement candidates, programming questions and answers on this topic often involve analyzing code behavior, debugging, and implementing logic using OOP principles like inheritance, polymorphism, and encapsulation. This section provides GATE-oriented C++ programming methodology questions with answers, enabling learners to practice concepts such as recursion, data abstraction, and error handling. Practicing these C++ questions helps in mastering both academic and placement-level programming skills.
GATE-Programming Methodology
Showing 10 of
105 questions
61. If four classes had the same friend function, you would forward declare
- nothing
- one class
- two classes
62. A friend function
- receives a this pointer for the class that makes it a friend
- receives a this pointer for any class that uses it
- receives a this pointer for any class object passes to it
- does not have a this pointer for the class that makes it a friend
63. The generic type in a template function
- must be T
- can be T
- cannot be T for functions you create, but may be for C + +, a built -in function
- cannot be T.
64. When a function tries to access an object's private data member
- if the function is a member function, then access is approved
- if the function is a friend function, then access is denied
- both (a ) and (b)
- None of these
65. The prototypes for friend functions are most often listed in the
- private declaration section
- public declaration section
- implementation section
- none of thses
66. A dumb terminal has
- prototypes for all functions that are friends of a class are listed with the other function prototypes
- outside the class definition, but within the same file
- in the class declaration section
- in the class implementation section
67. A class may
- not have friends
- have one friend
- have one friend function and one friend class
- have any number of friends
68. You use data hiding when you create
- inline functions
- private class members
- nonscalar types
- cryptic code
69. Classes can bestow friendship on
- nonmember functions
- functions that are members of other classes
- both (a) and (b )
- none of these
70. You may grant friendship to
- no member functions of other classes
- one member function from one other class
- one member function each from as many classes as appropriate
- as many member functions of other classes as appropriate