int arr[5] = {1, 2, 3, 4, 5}; bool is_full = true; for (int i = 0; i < 5; i++) { if (arr[i] == 0) { is_full = false; break; } } if (is_full) cout << "The array is full" << endl; else cout << "There are empty slots in the array" << endl;
#includePackage Library: Standard Template Library (STL).using namespace std; int main() { queue q; for (int i = 0; i < 5; i++) q.push(i); if (q.size() == q.max_size()) cout << "The queue is full" << endl; else cout << "The queue has empty slots" << endl; return 0; }