Rewrite the code below using the for each loop construct provided in C++11.

```
int b[5] = {3,4,5,6,7};
int sum = 0;
for (int j = 0; j < 5; j++)
sum+=b[j];
```What will be an ideal response?

```
int b[5] = {3,4,5,6,7};
int sum = 0;
for (int val : b)
sum+=val;
```

Computer Science & Information Technology

You might also like to view...

Valid attributes for the media attribute of the