queue cpp

include

include

int main() { std::queue myQueue;

myQueue.push(10); // Adds 10 to the back of the queue
myQueue.push(20); // Adds 20 to the back of the queue
myQueue.push(30); // Adds 30 to the back of the queue

std::cout << "Front of the queue: " << myQueue.front() << std::endl; // Prints the element at the front of the queue
std::cout << "Back of the queue: " << myQueue.back() << std::endl; // Prints the element at the back of the queue

myQueue.pop(); // Removes the element at the front of the queue

std::cout << "Front of the queue after pop: " << myQueue.front() << std::endl; // Prints the new element at the front of the queue

std::cout << "Size of the queue: " << myQueue.size() << std::endl; // Prints the size of the queue

return 0;

}