#include#include using namespace std; int main() { list
lst{1, 2, 3}; lst.push_front(0); for(auto it = lst.begin(); it != lst.end(); ++it) cout << *it << " "; return 0; }
#includeOutput: orange apple banana cherry In this example, a list of strings is created and initialized with values "apple", "banana", and "cherry". The push_front() function is used to insert an element with value "orange" at the front of the list. The elements of the list are then printed using a for loop. The std::list package library is part of the C++ Standard Library.#include using namespace std; int main() { list
lst{"apple", "banana", "cherry"}; lst.push_front("orange"); for(auto it = lst.begin(); it != lst.end(); ++it) cout << *it << " "; return 0; }