Vidyalelo
C++ Programming · Q303

C++ miscellaneous

Programming · C++ Programming · question 303

Q303

What will be the output of the following C++ code? #include using namespace std; int main() int a = 5; auto check = [=]() a = 10; ; check(); cout<<"Value of a: "<<a<<endl; return 0;

A.
Value of a: 5
B.
Value of a: 10
C.
Error
Answer
D.
Segmentation fault

Answer: Option C

Solution

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