Array Lists
Task1: Write a program that displays the contents of the array. Declare and array and initialize the
array elements. This program will print out an initialized array using a for loop.
Input:
1. array SIZE
2. initialized array list: 6, 7, 8, 10, 12, 14, 17, 21, 24, 28, 36
Processing:
3. Use a for loop to filter through the array
Output: Display the initialized array list. Make sure the list is on the same line with spaces between
them. Include a new line after the output.
Task2: Write a program that displays the contents of the vector. Declare vector values using the
pushback function. Using a for loop through the vector - will return the length of the vectorg a for
loop.
Input:
1. Use a vector to initialize values
2. initialized: (2) (4) (6) (8) (10)
3. Use the push_back for the list.
Processing:
4. Use a for loop to filter through the vector
Output: Display the initialized vector list. Make sure the list is on a new line.