42.
What will be the output of the following C++ code?
#include<iostream>
using namespace std;
class X 
{
    int m;
    public:
    X() : m(10)
    {                                                       
    }
    X(int mm): m(mm)
    {
    }
    int getm()
    {
        return m;
    }
};
class Y : public X 
{
    int n;
    public:
    Y(int nn) : n(nn) {}                                                
    int getn() { return n; }
};
int main()
{
    Y yobj( 100 );
    cout << yobj.getm() << " " << yobj.getn() << endl;
}

43.
What will be the output of the following C++ code?
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
	bitset<8> b1(95);
	bitset<8> b2(45);
	cout<<~b1<<endl;
	cout<<(b1|b2)<<endl;
	cout<<(b1&b2)<<endl;
}

46.
What will be the output of the following C++ code?
#include <iostream>
#include <functional>
#include <numeric>
using namespace std;
int myfunction (int x, int y) 
{
    return x + 2 * y;
}
struct myclass 
{
    int operator()(int x, int y) 
    {
        return x + 3 * y;
    }
} myobject;
int main () 
{
    int init = 100;
    int numbers[] = {10, 20, 30};
    cout << accumulate(numbers, numbers + 3, init);
    cout << endl;
}

48.
What is meant by pure virtual function?

49.
What will be the output of the following C++ code?
#include <iostream>
#include <complex>
using namespace std;
int main()
{
	complex <double> cn(3.0, 5.0);
	cout<<"Complex number is: "<<real(cn)<<" + "<<imag(cn)<<"i"<<endl;
	return 0;
}

50.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class poly
{
    protected:
    int width, height;
    public:
    void set_values(int a, int b)
    {
        width = a; height = b;
    }
};
class Coutput
{
    public:
    void output(int i);
};
void Coutput::output(int i)
{
    cout << i;
}
class rect:public poly, public Coutput
{
    public:
    int area()
    {
        return(width * height);
    }
};
class tri:public poly, public Coutput
{
    public:
    int area()
    {
        return(width * height / 2);
    }
};
int main()
{
    rect rect;
    tri trgl;
    rect.set_values(3, 4);
    trgl.set_values(4, 5);
    rect.output(rect.area());
    trgl.output(trgl.area());
    return 0;
}