51. Aggregation is a . . . . . . . . type of Association relationship.
52. How many parameters are present in mismatch method in non-sequence modifying algorithm?
53. What type of class member is operator new?
54. What will be the output of the following C++ codes?
i.
#ifndef Exercise_H
#define Exercise_H
int number = 842;
#endif
ii.
#include <iostream>
#include "exe.h"
using namespace std;
int main(int argc, char * argv[] )
{
cout << number++;
return 0;
}
i.
#ifndef Exercise_H
#define Exercise_H
int number = 842;
#endif
ii.#include <iostream>
#include "exe.h"
using namespace std;
int main(int argc, char * argv[] )
{
cout << number++;
return 0;
}55. 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());
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());
cout<<v.front();
}56. What will be the output of the following C++ code?
#include <iostream>
#include <map>
using namespace std;
int main ()
{
multimap<char, int> mymultimap;
mymultimap.insert(make_pair('y', 202));
mymultimap.insert(make_pair('y', 252));
pair<char, int> highest = *mymultimap.rbegin();
multimap<char, int> :: iterator it = mymultimap.begin();
do
{
cout << (*it).first << " => " << (*it).second << '\n';
} while ( mymultimap.value_comp()(*it++, highest) );
return 0;
}
#include <iostream>
#include <map>
using namespace std;
int main ()
{
multimap<char, int> mymultimap;
mymultimap.insert(make_pair('y', 202));
mymultimap.insert(make_pair('y', 252));
pair<char, int> highest = *mymultimap.rbegin();
multimap<char, int> :: iterator it = mymultimap.begin();
do
{
cout << (*it).first << " => " << (*it).second << '\n';
} while ( mymultimap.value_comp()(*it++, highest) );
return 0;
}57. Which of the following is correct about the map and unordered map?
58. Which operator is used in pointer to member function?
59. What will be the output of the following C++ function?
#include <iostream>
using namespace std;
template <typename T>
T max(T x, T y)
{
return (x > y)? x : y;
}
int main()
{
cout << max(3, 7) << std::endl;
cout << max(3.0, 7.0) << std::endl;
cout << max(3, 7.0) << std::endl;
return 0;
}
#include <iostream>
using namespace std;
template <typename T>
T max(T x, T y)
{
return (x > y)? x : y;
}
int main()
{
cout << max(3, 7) << std::endl;
cout << max(3.0, 7.0) << std::endl;
cout << max(3, 7.0) << std::endl;
return 0;
}60. What kind of execution does sequence point allow?
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 2
- 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 9
- C plus plus miscellaneous - Section 10
- C plus plus miscellaneous - Section 11
