2.
In nested try catch blocks, if both inner and outer catch blocks are unable to handle the exception thrown, then . . . . . . . .

4.
What will be the output of the following C++ code?
#include <iostream> 
#include <vector> 
 
using namespace std; 
 
int main() 
{ 
    vector<int> v1;
    vector<char> v2; 
    for (int i = 1; i <= 5; i++) 
        v1.push_back(i);
    for (int i = 6; i <= 10; i++) 
        v2.push_back(i);
    v1.swap(v2);
    for(int i=0;i<v1.size();i++)
    	cout<<v1[i]<<" ";
    for(int i=0;i<v2.size();i++)
    	cout<<v2[i]<<" ";
    cout<<endl;
    return 0; 
}

5.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void empty() throw() 
{
    cout << "In empty()";
}
void with_type() throw(int) 
{
    cout << "Will throw an int";
    throw(1);
}
int main() 
{
    try 
    {
        empty();
        with_type();
    }
    catch (int) 
    {
        cout << "Caught an int";
    }
}

6.
What will be the output of the following C++ code?
#include<iostream>
#include<stdlib.h>
using namespace std; 
template<class T, class U>
class A  
{
    T x;
    U y;
};
 
int main()  
{
   A<char, char> a;
   A<int, int> b;
   cout << sizeof(a) << endl;
   cout << sizeof(b) << endl;
   return 0;
}

9.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class bowl 
{
    public:
    int apples;
    int oranges;
};
int count_fruit(bowl * begin, bowl * end, int bowl :: *fruit)
{
    int count = 0;
    for (bowl * iterator = begin; iterator != end; ++ iterator)
       count += iterator ->* fruit;
    return count;
}
int main()
{
    bowl bowls[2] = {{ 1, 2 },{ 3, 5 }};
    cout << "I have " << count_fruit(bowls, bowls + 2, & bowl :: apples) << " apples\n";
    cout << "I have " << count_fruit(bowls, bowls + 2, & bowl :: oranges) << " oranges\n";
    return 0;
}

10.
What will be the output of the following C++ code?
#include <iostream>
#include <Valarray>
using namespace std;
int main()
{
	Valarray<int> varr = { 10, 2, 20, 1, 30 };
	for (int &x: varr) cout << x << " ";
	cout<<endl;
	varr = varr.apply([](int x){return x+=5;});
	for (int &x: varr) cout << x << " ";
	return 0;
}