How many times is 'abc' printed?
Which of the following is C++ equivalent for scanf()?
Which of the following is the header file for using sort()
Where to place “f” with a double constant 3.14 to specify it as a float?
How many swaps are required for reversing an array having n elements where n is an odd number?
Which of the following statements regarding inline functions is correct?
What is static binding?
What will be the output of 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);
cout << v.capacity() << endl;
v.pop_back();
v.pop_back();
cout << v.capacity() << endl;
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int myints[] = {1, 2, 3, 4, 5};
vector<int> v(myints, myints + 5);
v.push_back(33);
push_heap(v.begin(), v.end());
cout << v.front() << '\n';
sort_heap(v.begin(), v.end());
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int myints[] = {10, 20, 30, 5, 15};
vector<int> v(myints, myints + 5);
make_heap(v.begin(), v.end());
pop_heap(v.begin(), v.end());
v.pop_back();
cout << v.front() << '\n';
return 0;
}