82.
What will be the output of the following C++ code?
#include <iostream>
#include <array>
 
using namespace std;
 
int main(int argc, char const *argv[])
{
	array<int, 10> arr1 = {1,2,3,4,5};
	array<int, 5> arr2 = {6,7,8,9,10};
	arr1.swap(arr2);
	for(int i=0;i<5;i++)
		cout<<arr1[i]<<" ";
	cout<<endl;
	for(int i=0;i<5;i++)
		cout<<arr2[i]<<" ";
	cout<<endl;
	return 0;
}

84.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class vec
{
    public:
    vec(float f1, float f2) 
    {
        x = f1;
        y = f2;
    }
    vec()
    {
    }
    float x;
    float y;
};
vec addvectors(vec v1, vec v2);
int main() 
{
    vec v1(3, 6);
    vec v2(2, -2);
    vec v3 = addvectors(v1, v2);
    cout << v3.x << ", " << v3.y << endl;
}
vec addvectors(vec v1, vec v2)
{
    vec result;
    result.x = v1.x + v2.x;
    result.y = v1.y + v2.y;
    return result;
};

86.
Given below classes which of the following are the possible row entries in vtable of D2 class?
class Base
{
    public:
    virtual void function1() {};
    virtual void function2() {};
};
class D1: public Base
{
    public:
    virtual void function1() {};
};
class D2: public Base
{
    public:
    virtual void function2() {};
};

87.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main () 
{
    char str[] = "Steve jobs";
    int val = 65;
    char ch = 'A';
    cout.width (5);
    cout << right;
    cout << val << endl;
    return 0;
}

88.
What will be the output of the following C++ code?
#include <iostream>
using namespace std; 
template <class T>
T max (T &a, T &b)
{
	cout << "Template Called ";
    return (a > b)? a : b;
}
 
template <>
int max <int> (int &a, int &b)
{
    cout << "Called ";
    return (a > b)? a : b;
}
 
int main ()
{
    int a = 10, b = 20;
    cout << max <int> (a, b);
}

89.
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
class A
{
	int a;
   public:
	virtual void func() = 0;
};
 
class B: public A
{
   public:
	void func(){
		cout<<"Class B"<<endl;
	}	
};
 
int main(int argc, char const *argv[])
{
	A a;
	a.func();
	return 0;
}