✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the output of the following code fragment?
int a[] { 2, 1, 0 };
int n = 0;
for (int v : a) { v++; n += v; }
for (int& v : a) { n++; v += n; }
std::cout << n << ' '
<< a[0] << ' ' << a[1] << ' ' << a[2] << '\n';
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!