ExamVeda
Login
Home
61
What will be the output of the following C++ code?
#include <iostream>
#include <set>
using namespace std;
int main ()
{
    set<int> myset;
    myset.insert(20);
    myset.insert(30);
    myset.insert(10);
    while (!myset.empty())
    {
        cout << ' ' << *myset.begin();
        myset.erase(myset.begin());
    }
    cout << '\n';
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
62
How the list differs from vectors?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
63
Which alternative can replace the throw statement?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
64
What type of algorithm is not available in creating our own STL style algorithms?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
65
What will be the output of the following C++ code?
#include<iostream>
#include<any>
using namespace std;
int main()
{
	float val = 5.5;
	any var(val);
	cout<<var<<endl;
	char c = 'a';
	var.emplace<char>(c);
	cout<<var<<endl;
	return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
66
Which operator is used as not operator in bitset?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
67
What will be the output of the following C++ code?
#include <iostream>  
#include <utility>
 
using namespace std;
 
int main () 
{
  pair p(1,2);
  cout<<"Pair(first,second) = ("<<p.first<<","<<p.second<<")\n";
  return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following C++ code?
#include <iostream>
#include <stack>
using namespace std;
int main ()
{
    stack<int> myints;
    cout  << (int) myints.size();
    for (int i = 0; i < 5; i++) myints.push(i);
    cout  << (int) myints.size() << endl;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
69
What is the use of sort_heap() function in heap?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
70
What is the use of sum() function in Valarray?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board