title: menue driven program to perform the following queue operation using array en-queue, de-queue, count the number of elements and display in c++?
body: <p>i need to make a C++ program for
  menu driven program to perform the following queue operation using array en-queue, de-queue, count the number of elements and display in c++?
  how to make this one ?
  im very weak in c++ can anyone guide me or help me or link me to a complete program to study it and understand it?!!!
  i tried but i coudnt do it so i really need help</p>
  
  <p>is this right or not ?</p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;conio.h&gt;
  void push(int st[],int data,int &amp;top);      //declaring a push class
  void disp(int st[],int &amp;top);       //declaring display class
  int pop(int st[],int &amp;top);                       //declaring a pop class
  int flg=0;
  int top=-1,tos=-1;
  int st[50];
  
  void push(int st[],int data,int &amp;top)          //push
  {
      if(top==50-1)
      flg=0;
      else
      {
          flg=1;
          top++;
          st[top]=data;
      }
  }
  
  int pop(int st[],int &amp;top)                      //pop
  {
      int pe;
      if(top==-1)
      {
          pe=0;
          flg=0;
      }
      else
      {
          flg=1;
          pe=st[top];
          top--;
      }
  
      return(pe);
  }
  
  void disp(int st[],int &amp;top)                //display
  {
      int i;
      if(top==-1)
      {
          cout&lt;&lt;"\nStack is Empty";
      }
      else
      {
          for(i=top;i&gt;=0;i--)
          cout&lt;&lt;"\t"&lt;&lt;st[i];
      }
  }
  
  void main()
  {
      int dt,opt;                              // declare varible
      int q=0;
      clrscr();
      cout&lt;&lt;"\t\t\tStack operations";
      cout&lt;&lt;"\n\n\tMain Menu.........";
      cout&lt;&lt;"\n\n1.Push";
      cout&lt;&lt;"\n\n2.Pop";
      cout&lt;&lt;"\n\n3.Exit";
      cout&lt;&lt;"\n\n4.display";
  
      do                                     // useing do while for to make choice and select any options
      {
          cout&lt;&lt;"\n\n\tEnter Your Choice 1-4:";            //entering your choice
          cin&gt;&gt;opt;
  
          switch(opt)
          {
              case 1:
                  cout&lt;&lt;"\nEnter the Element to be Push:";
                  cin&gt;&gt;dt;
                  push(st,dt,tos);
  
                  if(flg==1)
                  {
                      cout&lt;&lt;"the push is done";
  
                      if(tos==50-1)
                          cout&lt;&lt;"\nStack is Now Full";
                  }
                  else
                     cout&lt;&lt;"\nStack Overflow Insertion Not Possible";
              break;
              case 2:
                  dt=pop(st,tos);
                  if(flg==1)
                  {
                      cout&lt;&lt;"\n\tData Deleted From the Stack is:"&lt;&lt;dt;
                      cout&lt;&lt;"\n \t pop is done";
                  }
                  else
                      cout&lt;&lt;"\nStack Empty,Deletio Not Possible:";
              break;
              case 3:
                  q=1;
              break;
          default:
                              cout&lt;&lt;"\nWrong Choice Enter 1-3 Only";
  
          case 4:
                  disp(st,tos);
          break;
          }
      } while(q!=1);
  }
  </code></pre>