11. Which of the following is an arithmetic unary functor?
12. What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
vector<int> v = {4,2,10,5,1,8};
if (binary_search(v.begin(), v.end(), 4))
cout << "found.\n";
else
cout << "not found.\n";
return 0;
}
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
vector<int> v = {4,2,10,5,1,8};
if (binary_search(v.begin(), v.end(), 4))
cout << "found.\n";
else
cout << "not found.\n";
return 0;
}13. Which is optional in the declaration of vector?
14. How many types of output stream classes are there in c++?
15. What is the syntax of defining lambda expression?
16. What happens when both of the following C++ programs are compiled and executed?
===== Program 1 =====
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<int,5> arr1;
arr1.fill(5);
cout<<get<5>(arr1);
return 0;
}
=====================
===== Program 2 =====
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<int,5> arr1;
arr1.fill(5);
cout<<arr1.at(5);
return 0;
}
=====================
===== Program 1 =====
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<int,5> arr1;
arr1.fill(5);
cout<<get<5>(arr1);
return 0;
}
=====================
===== Program 2 =====
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<int,5> arr1;
arr1.fill(5);
cout<<arr1.at(5);
return 0;
}
=====================17. What will be the output of the following C++ code?
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i;
char str[] = "jobs...";
i = 0;
while ( isalnum(str[i] ))
i++;
printf (" %d\n",i);
return 0;
}
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i;
char str[] = "jobs...";
i = 0;
while ( isalnum(str[i] ))
i++;
printf (" %d\n",i);
return 0;
}18. What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<rank<int[10]>::value;
cout<<rank<char[10][10]>::value;
cout<<rank<string[10][10][10]>::value;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<rank<int[10]>::value;
cout<<rank<char[10][10]>::value;
cout<<rank<string[10][10][10]>::value;
return 0;
}19. Where is the derived class is derived from?
20. What does the function objects implement?
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
