What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <tuple>
using namespace std;
int main()
{
tuple <int, char, string> tp;
tp = make_tuple(4, '1', "Hello");
cout<<get<0>(tp)<<endl;
cout<<get<1>(tp)<<endl;
cout<<get<2>(tp)<<endl;
return 0;
}
#include <iostream>
#include <string>
#include <tuple>
using namespace std;
int main()
{
tuple <int, char, string> tp;
tp = make_tuple(4, '1', "Hello");
cout<<get<0>(tp)<<endl;
cout<<get<1>(tp)<<endl;
cout<<get<2>(tp)<<endl;
return 0;
}A. 1
Hello
4
B. 4
Hello
1
C. Hello
4
1
D. 4
1
Hello
Answer: Option D

Join The Discussion