Advertisement
vaibhav1906

Queue

Dec 17th, 2021
1,277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5.     queue<int>q;
  6.    
  7.     q.push(5); //5
  8.     q.push(2); //5,2
  9.     q.push(7); //5,2,7
  10.    
  11.     cout<<"front element in queue is : "<<q.front()<<endl; //5
  12.    
  13.     q.pop();
  14.     //queue now : 2,7
  15.     cout<<"front element in queue is : "<<q.front()<<endl; //2
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement