#include#include using namespace std; int main() { vector v; if(v.empty()){ cout << "Vector is empty" << endl; }else{ cout <<"Vector is not empty" << endl; } return 0; }
#includeOutput: Vector is empty Package library: STL (Standard Template Library)#include using namespace std; int main() { vector v = {1,2,3}; v.clear(); if(v.empty()){ cout << "Vector is empty" << endl; }else{ cout <<"Vector is not empty" << endl; } return 0; }