LG Previous Years Solved Sample Placement Papers
-
QUESTION: Which of the following is not an extension associated during the creation of a C++ program?
A: .cpp
B: .exe
C: .jpg
D: .bak
Ans: C -
QUESTION: Why every program begins with
main()
in C++?A: As this is from the compiler knows that program execution actually starts.
B: Because its name is main
C: Both A and B
D: None of above
Ans: A -
QUESTION: The wrapping up of data and functions into a single unit is called?
A: Inheritance
B: Polymorphism
C: Encapsulation
D: Overloading
Ans: C -
QUESTION: The process by which objects of one class acquire the attributes of another class is known as?
A: Inheritance
B: Polymorphism
C: Data Abstraction
D: Binding
Ans: A -
QUESTION: The technique by which objects communicate with each other is called?
A: information passing
B: function passing
C: message passing
D: none of above
Ans: B -
QUESTION: Which of the following is false?
A: Variable has scope & visibility
B: Variables having scope may not be visible
C: Variables having visibility may not have scope
D: None of these
Ans: C -
QUESTION: For a method to be an interface between the outside world and a class, it has to be declared?
A: private
B: protected
C: public
D: external
Ans: C -
What is the error in the following code?
class t { virtual void print(); }
A: No error
B: Function print() should be declared as static.
C: Function print() should be defined.
D: Class t should contain data members.
Ans: A -
It is possible to declare as a friend
A: A member function
B: A global function
C: A class
D: All of the above
Ans: D -
How many types of expressions in C++?
A: 5
B: 6
C: 7
D: 8
Ans: C -
QUESTION: Dragons have wings like a bird and scales like a lizard. In object-oriented verbiage, we would say this is an example of?
A: Multilevel Inheritance
B: Polymorphism
C: Multiple inheritance
D: Aggregation
Ans: C -
QUESTION: Which of the following is false about object-oriented?
A: is block structured language
B: is not a block structured language
C: aids in object-oriented programming
D: is an extension of C
Ans: A -
QUESTION: Polymorphism is implemented through which mechanism in C++?
A: Late Interpretation
B: Late Binding
C: Early Binding
D: Overloading
Ans: C