C++ Programming Multiple Choice Question - OOPS Concept

This section focuses on the "OOPS Concept" of the C++ programming. These Multiple Choice Questions (mcq) should be practiced to improve the C++ programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1.The OOPs concept in C++, exposing only necessary information to users or clients is known as

A. Data hiding
B. Encapsulation
C. Hiding complexity
D. Abstraction

View Answer


2.What is the output of this program?
Note:Includes all required header files

  using namespace std;
   abstract class course
    {
      public : int p;
      find();
    }
   class team:public course
    {
      public : find()
       {
       return 10;
       }
    };
   class ave:public course
   &nsbp;{
      public : find()
       {
       return 20;
       }
    };
   class failed{ int p; };

A. Only class course can show polymorphism
B. Only class course and team together can show polymorphism
C. All class course, team and ave together can show polymorphism
D. Class failed should also inherit class course for this code to work for polymorphism

View Answer


3.Which is private member functions access scope?

A. Member functions which can used outside the class
B. Member functions which are accessible in derived class
C. Member functions which can only be used within the class
D. Member functions which can’t be accessed inside the class

View Answer


4.What is the output of this program?
Note:Includes all required header files

using namespace std;
class team
{
public : int member;
void find()
{
cout<<"Its base class";
};
class course:public team
{
public :
void find()
{
cout<<”Its derived class”;
}
}
void main() { team t; course c;
t.find();
c.find();
}

A. Its base classIts derived class
B. Its base class Its derived class
C. Its derived classIts base class
D. Its derived class Its base class

View Answer


5.C++ was originally developed by

A. Sir Richard Hadlee
B. Clocksin and Mellish
C. Donald E. Knuth
D. Bjame Stroustrup

View Answer


6.What is the output of this program?
Note:Includes all required header files

using namespace std;
class course
{
char name[10];
public : find()
{
cout<<”Its course system”;
}
class team:public course
{
public: void find()
{
cout<<”Its team course system”;
}
};
void main()
{
team t;
t.find();
}
}

A. Its team course system
B. Its course system
C. Its team course systemIts course system
D. Its course systemIts team course system

View Answer






Also check :


Discussion


* You must be logged in to add comment.