- Type
- Quiz
- Course
- CS304P Object Oriented Programming (Practical)
- Size
- PDF 846 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2 of 2. Download the file for all 2 pages.
Q1. What will be the output of the following program? #include<iostream> using namespace std; class House{ private: int rooms; public: House() { cout<<"Entering the house"<<endl;} House(int R) { rooms = R;} ~House() { cout<<"Leaving the house"<<endl;} }; class Kitchen : public House { double size; public: Kitchen() : House() { cout<<"Entering the kitchen";} }; int main() { Kitchen Obj; return 0; }
Correct answer: Entering the house Entering the kitchen Leaving the house
Q2. Which of the following is unary operator in C++?
Correct answer: ++
Q3. Which of the following is not the correct type of inheritance in C++?
Correct answer: secret
Q4. Consider the code below, class class1{ public: void func1(); }; class class2 : public class1 { }; Function func()1 of class1 is ______ in class2.
Correct answer: Public
Q5. "cin" is an object of ____ class.
Correct answer: istream
Q6. For the given class definition, which one is correct? #include<iostream> using namespace std; class A{ int x,y; public: int Add(int a,int b){return a+b;} int Add(int c){return c;} };
Correct answer: Function Add is overloaded
Q7. What will be the output of following C++ code? int a=5; cout<<a++;
Correct answer: 5
Q8. Which of the following is correct symbol of stream extraction operator?
Correct answer: >>
Q9. If the programmer does not specify the type of inheritance then the default type of inheritance is
Correct answer: Private
Q10. In case of public inheritance between Base class A and Derived class B, which of the folllowing data members of Base class will be hidden in Derived class?
Correct answer: private
Related CS304P files
All CS304P files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.