4.5

// Created by MBBahodir
#include "stdafx.h"
#include <iostream>
#include <queue>   
using namespace std;
 
int main() {
  queue <int> q;   
 
  for (int h = 0; h < 7; h  ) { 
      q.push(rand()0);  
  }
 
  cout << "Navbatdigi birinchi element " << q.front() << endl;   
  cout << "Navbatdigi oxirgi element " << q.back() << endl;                                                                     
  q.pop();   
    
  cout << "Navbatdigi birinchi element (oʻchirishdan soʻng): " << q.front() << endl;
    
  cout << "Navbat boʻsh " << (q.empty()?"":"emas") << endl; 
    
  system("pause");
  return 0;
}

Run on cpp.sh