Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp;
tp = make_tuple("Hello", 4, 'c');
return 0;
}
Correct Answer is : Uni-directional
2. What is the use of get() function in tuples?
Correct Answer is : Number of elements
3. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp;
tp = make_tuple(4, '1', "Hello");
cout<(tp)<(tp)<(tp)<
Correct Answer is : Number of elements
4. Which of the following is correct about tuple_size?
Correct Answer is : Both assignment operator and copy constructor
5. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp;
tp = make_tuple(4, '1', "Hello");
cout<::value;
return 0;
}
Correct Answer is : Both assignment operator and copy constructor
6. Which of the following is correct about swap()?
Correct Answer is : 36527
7. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp1;
tuple tp2;
tp1 = make_tuple(6, 'a', "Hello");
tp2 = make_tuple(9, 'z', "World");
cout<<"("<(tp1)<<", "<(tp1)<<", "<(tp1)<<")"<(tp2)<<", "<(tp2)<<", "<(tp2)<<")"<(tp1)<<", "<(tp1)<<", "<(tp1)<<")"<(tp2)<<", "<(tp2)<<", "<(tp2)<<")"<
Correct Answer is : 36527
8. What is the use of tie() function?
Correct Answer is : 94
9. How many variants of tie() function is there?
Correct Answer is : 94
10. Which word is used to stop the unpacking of a value in a tuple?
Correct Answer is : 1 3 6 8 9
11. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp1;
tp1 = make_tuple(6, 'a', "Hello");
int x;
char y;
string z;
tie(x,y,z) = tp1;
cout<<"x: "<
Correct Answer is : 1 3 6 8 9
12. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp1;
tp1 = make_tuple(6, 'a', "Hello");
int x;
string y;
tie(x,ignore,y) = tp1;
cout<<"x: "<
Correct Answer is : None of the mentioned
13. What is the use of tuple_cat() function?
Correct Answer is : None of the mentioned
14. What is the output of the following C++ code?
#include
#include
#include
using namespace std;
int main()
{
tuple tp1;
tuple tp2;
tp1 = make_tuple(0, "Hello");
tp2 = make_tuple(1, "World");
auto tp3 = tuple_cat(tp1, tp2);
cout<<"("<(tp3)<<", "<(tp3)<<", "<(tp3)<<",
"<(tp3)<<")"<
Correct Answer is : 60
15. What is the size of wchar_t in C++?
Correct Answer is : 60
16. Pick the odd one out
Correct Answer is : To provide interface
17. Which data type is used to represent the absence of parameters?
Correct Answer is : To provide interface
18. What does ‘\a’ escape code represent?
Correct Answer is : Associated iterator type
19. Which type is best suited to represent the logical values?
Correct Answer is : Associated iterator type
20. Identify the user-defined types from the following?
Correct Answer is : A template is a formula for creating a generic class