#include<iostream>

#include<queue>

using namespace std;

int main(){

    //elements

    queue<int>nums;

    //push element into queue

    nums.push(1);
    nums.push(3);
    nums.push(5);

    //elemnt at first
    int front = nums.front();

    cout<<"first element :"<<front<<endl;

    //element at second

    int back = nums.back();
    cout<<"second element:"<<back<<endl;

    return 0;

}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: