11. What happens when only one argument is supplied to flip() function?
12. What will be the output of the following C++ code in the text file?
#include <stdio.h>
int main ()
{
FILE * pFile;
char c;
pFile = fopen("sample.txt", "wt");
for (c = 'A'; c <= 'E'; c++)
{
putc (c, pFile);
}
fclose (pFile);
return 0;
}
#include <stdio.h>
int main ()
{
FILE * pFile;
char c;
pFile = fopen("sample.txt", "wt");
for (c = 'A'; c <= 'E'; c++)
{
putc (c, pFile);
}
fclose (pFile);
return 0;
}13. What will be the output of the following C++ code?
#include<iostream>
#include <string>
using namespace std;
template <class T>
class Print
{
public:
int operator()(T a){
cout<<a<<endl;
}
};
int main()
{
Print<string> str;
Print<int> integer;
int a = 100;
string s = "Hello World";
str(s);
integer(a);
return 0;
}
#include<iostream>
#include <string>
using namespace std;
template <class T>
class Print
{
public:
int operator()(T a){
cout<<a<<endl;
}
};
int main()
{
Print<string> str;
Print<int> integer;
int a = 100;
string s = "Hello World";
str(s);
integer(a);
return 0;
}14. Which function is used to swap two vectors?
15. What will be the output of the following C++ code?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
deque<int> mydeque;
int sum (0);
mydeque.push_back ( 10 );
mydeque.push_back ( 20 );
mydeque.push_back ( 30 );
while (!mydeque.empty())
{
sum += mydeque.back();
mydeque.pop_back();
}
cout << sum << '\n';
return 0;
}
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
deque<int> mydeque;
int sum (0);
mydeque.push_back ( 10 );
mydeque.push_back ( 20 );
mydeque.push_back ( 30 );
while (!mydeque.empty())
{
sum += mydeque.back();
mydeque.pop_back();
}
cout << sum << '\n';
return 0;
}16. Which of the following type does the container should define?
17. Which header file is required to use pair container in your program?
18. Which header file is required to use heap in your program?
19. Which of the following is correct about none() function in bitset?
20. Which of the following header file does not exist?
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 8
- C plus plus miscellaneous - Section 9
- C plus plus miscellaneous - Section 11
