Mark As Completed Discussion

Build your intuition. Fill in the missing part by typing it in.

Exercise 4:

In C++, the ______ loop is used to iterate over the elements of a container, such as a vector or a list.

Solution: for each

Explanation: In C++, the for each loop (also known as the range-based for loop) is used to iterate over the elements of a container, such as a vector or a list. It simplifies the process of iterating over a range of values and eliminates the need for manually managing iterators.

Write the missing line below.