41.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
template<typename type> 
class Test
{
    public:
    Test()
    {
    };
    ~Test()
    {
    };
    type Funct1(type Var1)
    {
        return Var1;
    }
    type Funct2(type Var2)
    {
        return Var2;
    }
};
int main()
{
    Test<int> Var1;
    Test<float> Var2;
    cout << Var1.Funct1(200) << endl;
    cout << Var2.Funct2(3.123) << endl;
    return 0;
}

42.
What will be the output of the following C++ code?
#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int main ()
{
    int first[] = {10, 40, 90};
    int second[] = {1, 2, 3};
    int results[5];
    transform ( first, first + 5, second, results, divides<int>());
    for (int i = 0; i < 3; i++)
        cout << results[i] << " ";
    return 0;
}

43.
What will be the output of the following C++ code?
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
	bitset<8> b1(20);
	cout<<b1.none();
	cout<<b1.any();
}

45.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void PrintSequence(int StopNum)
{
    int Num;
    Num = 1;
    while (true)
    {
        if (Num >= StopNum)
            throw Num;
        cout << Num << endl;
        Num++;
    }
}
int main(void)
{
    try
    {
        PrintSequence(2);
    }
    catch(int ExNum)
    {
        cout << "exception: " << ExNum << endl;
    }
    return 0;
}

46.
What will happen when introduce the interface of classes in a run-time polymorphic hierarchy?

47.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class BaseClass 
{
    int i;
    public:
    void setInt(int n);
    int getInt();
};
class DerivedClass : public BaseClass
{
    int j;
    public:
    void setJ(int n);
    int mul();
};
void BaseClass::setInt(int n)
{
    i = n;
}
int BaseClass::getInt()
{
    return i;
}
void DerivedClass::setJ(int n)
{
    j = n;
}
int DerivedClass::mul()
{
    return j * getInt();
}
int main()
{
    DerivedClass ob;
    ob.setInt(10);       
    ob.setJ(4);          
    cout << ob.mul();    
    return 0;
}