21. Which type of relationship is modelled by Composition?
22. Which of the following describes the protected access specifier?
23. Which is used to use a function from one source file to another?
24. Which is used for formatting purpose in c++?
25. Which is the correct way of handling arguments with spaces?
26. What will be the output of the following C++ code?
#include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> tst;
tst.insert(12);
tst.insert(21);
tst.insert(32);
tst.insert(31);
set<int> :: const_iterator pos;
for(pos = tst.begin(); pos != tst.end(); ++pos)
cout << *pos << ' ';
return 0;
}
#include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> tst;
tst.insert(12);
tst.insert(21);
tst.insert(32);
tst.insert(31);
set<int> :: const_iterator pos;
for(pos = tst.begin(); pos != tst.end(); ++pos)
cout << *pos << ' ';
return 0;
}27. What happens when no argument is supplied to flip() function?
28. What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int myints[] = {1, 2, 3};
sort (myints, myints + 3);
do
{
} while ( next_permutation(myints, myints + 3) );
cout << myints[0] << ' ' << myints[1] << ' ' << myints[2] << '\n';
return 0;
}
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int myints[] = {1, 2, 3};
sort (myints, myints + 3);
do
{
} while ( next_permutation(myints, myints + 3) );
cout << myints[0] << ' ' << myints[1] << ' ' << myints[2] << '\n';
return 0;
}29. How the size of a vector increases once it is full?
30. What will be the output of the following C++ code?
#include <iostream>
#include<type_traits>
using namespace std;
class Base
{
public:
};
int main()
{
Base b;
cout<<sizeof(b);
return 0;
}
#include <iostream>
#include<type_traits>
using namespace std;
class Base
{
public:
};
int main()
{
Base b;
cout<<sizeof(b);
return 0;
}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 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
