#includeIn this example, we create a list of integers and remove all occurrences of the value 3 using the remove() function. We then print the modified list. This function is part of the C++ Standard Library. Package/Library: "std" is part of the C++ Standard Library, so no external library needs to be installed for this function to be used.#include using namespace std; int main() { list
mylist = {1, 2, 3, 4, 5, 6, 7, 8, 9}; // Remove all occurrences of 3 mylist.remove(3); // Print the list for (auto it = mylist.begin(); it != mylist.end(); ++it) cout << *it << " "; cout << endl; return 0; }