41.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
    char name[30];
    cout << "Enter name: ";
    gets(name);
    cout << "Name: ";
    puts(name);
    return 0;
}

44.
What will be the output of the following C++ code?
#include <iostream> 
#include <vector> 
 
using namespace std; 
 
int main() 
{ 
    vector<int> v1;
    vector<int> 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; 
}

46.
Which of the following is correct about the shift?

47.
What will be the output of the following C++ code?
#include <vector> 
#include <algorithm> 
#include <iostream> 
 
using namespace std;
 
int main() 
{ 
    vector<int> v; 
    for(int i=0;i<10;i++)
 	v.push_back(i+1);
    for(int i=0;i<10;i++)
	cout<<v[i]<<" ";
    cout<<endl;
    random_shuffle(v.begin(), v.end());
    for(int i=0;i<10;i++)
	cout<<v[i]<<" ";
    return 0;
}

49.
What will be the output of the following C++ code?
#include<iostream>
#include "math.h"
using namespace std;
double MySqrt(double d)
{
    if (d < 0.0)
    throw "Cannot take sqrt of negative number";     
    return sqrt(d);
}
int main()
{
    double d = 5;
    cout << MySqrt(d) << endl;
}