61. What will be the output of the following C++ code?
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
vector <int> v = {1,5,23,90,15,35};
make_heap(v.begin(),v.end());
v.push_back(110);
push_heap(v.begin(), v.end());
pop_heap(v.begin(), v.end());
v.pop_back();
cout<<v.front();
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
vector <int> v = {1,5,23,90,15,35};
make_heap(v.begin(),v.end());
v.push_back(110);
push_heap(v.begin(), v.end());
pop_heap(v.begin(), v.end());
v.pop_back();
cout<<v.front();
}62. How many kinds of entities are directly parameterized in c++?
63. Which header file is required for using Valarray?
64. Which are the parameters for the content of the buffer?
65. What operation can be performed by destructor?
66. What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
template<class T>
T func(T a)
{
cout<<a;
return a;
}
template<class U>
void func(U a)
{
cout<<a;
}
int main(int argc, char const *argv[])
{
int a = 5;
int b = func(a);
return 0;
}
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
template<class T>
T func(T a)
{
cout<<a;
return a;
}
template<class U>
void func(U a)
{
cout<<a;
}
int main(int argc, char const *argv[])
{
int a = 5;
int b = func(a);
return 0;
}67. What will be the output of the following C++ code?
#include<iostream>
#include<any>
#include<string>
using namespace std;
int main()
{
string s = "Hello World";
any var(s);
cout<<any_cast<string>(var)<<endl;
return 0;
}
#include<iostream>
#include<any>
#include<string>
using namespace std;
int main()
{
string s = "Hello World";
any var(s);
cout<<any_cast<string>(var)<<endl;
return 0;
}68. What will be the output of the following C++ code?
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<bool> mask;
mask.push_back(true);
mask.flip();
cout << boolalpha;
for (unsigned i = 0; i < mask.size(); i++)
cout << mask.at(i);
return 0;
}
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<bool> mask;
mask.push_back(true);
mask.flip();
cout << boolalpha;
for (unsigned i = 0; i < mask.size(); i++)
cout << mask.at(i);
return 0;
}69. What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <bitset>
using namespace std;
int main ()
{
string mystring;
bitset<4> mybits;
mybits.set();
mystring = mybits.to_string<char, char_traits<char>,
allocator<char> >();
cout << mystring << endl;
return 0;
}
#include <iostream>
#include <string>
#include <bitset>
using namespace std;
int main ()
{
string mystring;
bitset<4> mybits;
mybits.set();
mystring = mybits.to_string<char, char_traits<char>,
allocator<char> >();
cout << mystring << endl;
return 0;
}70. What kind of exceptions are available in c++?
Read More Section(C plus plus miscellaneous)
Each Section contains maximum 100 MCQs question on C plus plus miscellaneous. To get more questions visit other sections.
- C plus plus miscellaneous - Section 1
- C plus plus miscellaneous - Section 3
- C plus plus miscellaneous - Section 4
- C plus plus miscellaneous - Section 5
- C plus plus miscellaneous - Section 6
- C plus plus miscellaneous - Section 7
- C plus plus miscellaneous - Section 8
- C plus plus miscellaneous - Section 9
- C plus plus miscellaneous - Section 10
- C plus plus miscellaneous - Section 11
