Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which concept of OOPs is shown by Virtual Functions?
Correct Answer is : ios::in|ios::out
2. What is the output of the following C++ code?
#include
#include
using namespace std;
class A
{
public:
virtual A(){
cout<<"A's Constructor\n";
}
};
class B: public A
{
public:
A(){
cout<<"Present inside the class B\n";
}
};
int main(int argc, char const *argv[])
{
A a;
return 0;
}
Correct Answer is : tell_p()
3. What is the output of the following C++ code?
#include
#include
using namespace std;
class A
{
public:
virtual static void show(){
cout<<"class A\n";
}
};
class B: public A
{
public:
static void show(){
cout<<"class B\n";
}
};
int main(int argc, char const *argv[])
{
A *a = new A();
B b;
a = &b;
a->show();
return 0;
}
Correct Answer is : seekg()
4. What is the output of the following C++ code?
#include
#include
using namespace std;
class A
{
int a;
public:
A(){
a = 0;
}
static void show(){
a++;
cout<