22.
What will be the output of the following C++ code?
#include <iostream>
#include <exception>
using namespace std;
int main () 
{
    try
    {
        int* myarray = new int[1000];
        cout << "allocated";
    }
    catch (exception& e)
    {
        cout << "Standard exception: " << e.what() << endl;
    }
    return 0;
}

24.
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
	cout<<is_same<int,char>::value;
	cout<<is_same<char[10], char[10]>::value;
	cout<<is_same<char*[10], string>::value;
	return 0;
}

25.
What will be the output of the following C++ code?
#include <iostream>
#include <queue>  
using namespace std;
int main ()
{
    queue<int> myqueue;
    myqueue.push(12);
    myqueue.push(75);  
    myqueue.back() -= myqueue.front();
    cout << myqueue.back() << endl;
    return 0;
}

26.
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, minus<int>() );
    cout << endl;
    return 0;
}

27.
What is the difference between begin() and cbegin() in vectors?

28.
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
	cout<<rank<remove_extent<string[10][20]>::type>::value;
	cout<<rank<remove_extent<string[10][20][30]>::type>::value;
	return 0;
}

29.
What will be the output of the following C++ code?
#include <stdio.h> 
#include <ctype.h>
int main ()
{
    int i = 0;
    char str[] = "C";
    while (str[i])
    {
        if (isalpha(str[i])) 
            printf ("alphabetic");
        else 
            printf ("not alphabetic");
        i++;
    }
    return 0;
}