C++ Programming Code Examples C++ > For Loops and While Loops Code Examples Nested Range-Based For Loop Nested Range-Based For Loop #include <iostream> using namespace std; int main () { int arr1[3] = {0,1,2}; int arr2[5] = {0,1,2,3,4}; for(int i : arr1) { for(int j : arr2) { cout << "i = " << i << " and j = " << j << endl; } } return 0; }