ExamVeda
Login
Home
1
What does a default header file contain?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
2
What will be the capacity of vector at the end in the following C++ code?
#include <iostream> 
#include <vector> 
 
using namespace std; 
 
int main() 
{ 
    vector<int> v; 
    for (int i = 1; i <= 5; i++) 
        v.push_back(i);
    v.reserve(50);
    cout<<v.capacity();
    return 0; 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
3
What will be the output of the following C++ code?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
    unsigned int i;
    deque<int> a (3,100);
    deque<int> b (5,200);
    a.swap(b);
    cout << "a contains:";
    for (deque<int>::iterator it = a.begin(); it != a.end(); ++it)
        cout << ' ' << *it;
    cout << "b contains:";
    for (deque<int>::iterator it = b.begin(); it != b.end(); ++it)
        cout << ' ' << *it;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
4
What will be the output of the following C++ code?
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
	bitset<8> b1(string("15"));
	cout<<b1;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
5
Which member function is used to determine whether the stream object is currently associated with a file?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
6
In how many ways we can handle errors in any class?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
7
How to handle the exception in constructor?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
8
What is the syntax of declaraing a forward_list?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
9
What will be the output of the following C++ code?
#include <iostream>
#include <typeinfo>
using namespace std;
class Polymorphic {virtual void Member(){}};
int main () 
{
    try
    {
        Polymorphic * pb = 0;
        typeid(*pb);   
    }
    catch (exception& e)
    {
        cerr << "exception caught: " << e.what() << endl;
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
10
What will be the output of the following C++ code?
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
	bitset<8> b1(95);
	bitset<8> b2 = b1 >> 3;
	cout<<b1<<endl<<b2;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board