ranged based for loop c++
for (int num : numbers) { std::cout << num << std::endl; }
The above code is an example of a ranged-based for loop in C++. In this loop, the "num" variable iterates over each element in the "numbers" collection, and the "std::cout" statement prints the value of "num" followed by a new line.