ExamVeda
Login
Home
71
What does the client module import?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
72
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
namespace Box1
{
    int a = 4;
}
namespace Box2
{
    int a = 13;
}
int main ()
{
    int a = 16;
    Box1::a;
    Box2::a;
    cout << a;
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
73
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
namespace A{
 
	int var = 10;
}
namespace B{
	int var = 5;
}
int main()
{
	using namespace B;
	cout<<var;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
74
What will be the output of following C++ code?
#include <iostream>
#include <string>
using namespace std;
namespace My_old_school_and_college_friends_number
{
	long int f1 = 9999999999;
	long int f2 = 1111111111;
}
namespace contacts = My_old_school_and_college_friends_number;
int main(){
 
	cout<<contacts::f1;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
75
What will be the output of the following C++ code?
#include <iostream>
#include <exception>
using namespace std;
int main()
{
    try 
    {
        int * array1 = new int[100000000];
        int * array2 = new int[100000000];
        int * array3 = new int[100000000];
        int * array4 = new int[100000000];
        cout << "Allocated successfully";
    }
    catch(bad_alloc&) 
    {
        cout << "Error allocating the requested memory." << endl;
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
76
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
double division(int a, int b)
{
    if (b == 0) 
    {
        throw "Division by zero condition!";
    }
    return (a / b);
}
int main ()
{
    int x = 50;
    int y = 2;
    double z = 0;
    try 
    {
        z = division(x, y);
        cout << z;
    }
    catch(const char *msg) 
    {
        cerr << msg;
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board