Vidyalelo
C++ Programming · Q551

C++ miscellaneous

Programming · C++ Programming · question 551

Q551

What will be 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: "<<x<<" : "<<y<<" : "<<z<<endl; return 0;

A.
Segmentation fault
z: Hello
B.
x: 6
z: Hello
y: a
C.
Error
D.
x: 6
y: a
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board