#include#include using namespace std; int main() { vector nums {1, 2, 3, 4, 5}; // Applying pop_back function nums.pop_back(); // Displaying the updated vector for(int num : nums) { cout << num << " "; } return 0; }
#includeOutput: Hello World Library: Standard Library in C++ (no package/library required)#include using namespace std; int main() { string s = "Hello World!"; // Applying pop_back function s.pop_back(); // Displaying the updated string cout << s; return 0; }