C++ Programming Language MCQ Question
c++ programming Language MCQ Questions with answers for professional interviews, tests & exams, Latest 2021 Download and get free bulk of MCQs bundle by one click.
C++ MCQs| Classes & Objects | Constructor And Destructor | Inheritance | File Handling | Functions| Pointers | Exception Handling| Templates | Referencesg | Overloading | Namespaces | Tuple | BitSet | Friend Function | Abstract Classes |
The OOPs concept in C++, exposing only necessary information to users or clients is known as
The OOPs concept in C++, exposing only necessary information to users or clients is known as Abstraction.
A class is made abstract by declaring at least one of its functions as?
A class is made abstract by declaring at least one of its functions as a pure virtual function.
Which is private member functions access scope?
The member functions can be accessed inside the class only if they are private. The access is scope is limited to ensure the security of the private members and their usage.
What is the output of this program?
#include <iostream> using namespace std; class team { public : int member; void LFC() { cout<<"Its base class"; }; }; class course:public team { public : void LFC() { cout<<"Its derived class"; } }; int main() { team t; course c; t.LFC(); c.LFC(); }
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
You need to focus on how the output is going to be shown, no space will be given after the first message from the base class. And then the message from the derived class will be printed. Function find() in the base class overrides the function of the base class is derived.
C++ was originally developed by
D C++ was originally developed by Bjame Stroustrup.
The output of this program is?
#include <iostream> using namespace std; class course { char name[10]; public : void LFC() { cout<<"Its course system"; } }; class team : public course { public: void LFC() { cout<<"Its team course system"; } }; int main() { team t; t.LFC(); }
A. Its team course system
B. Its course system
C. Its team course systemIts course system
D. Its course systemIts team course system
Notice that the function name in the derived class is different from the function name in a base class. Hence when we call the find() function, the base class function is executed. No polymorphism is used here.
Can main() function be made private?
The reason given in the c option is wrong. The proper reason that the main function should not be private is that it should be accessible throughout the whole program. This makes the program flexible.
At what point of time a variable comes into existence in memory is determined by its
a variable that comes into existence in memory is determined by its Storage class.
Which of the following concepts is used to implement late binding?
N/A
For Cat and Animal class, the correct way of inheritance is
N/A