title: while loop multiple statements
body: <p>I have some issues with looping. I am trying to loop multiple statements. Code is below.</p>
  
  <pre><code>int MenuSelect () {
      cout &lt;&lt; endl;
      cout &lt;&lt; YELLOW  &lt;&lt; "Enter 1 for info" &lt;&lt; endl;
      cout &lt;&lt; " " &lt;&lt; endl;
      cout &lt;&lt; "Enter 2 to Start" &lt;&lt; endl;
      cout &lt;&lt; " " &lt;&lt; endl;
      cout &lt;&lt; "Enter 3 to view settings" &lt;&lt; endl;
      cout &lt;&lt; " " &lt;&lt; endl;
      cout &lt;&lt; "Enter 4 to quit" &lt;&lt; endl;
  
       int selected = 0;
      string input;
      cin &gt;&gt; input;
      if (stringstream(input) &gt;&gt; selected) {
          return selected;
      }
      else {
          return -1;
      }
  
      return 0;
  
  };    
  
  int Menu(int) {
  
      int selected {};
      while ((selected = MenuSelect()) == 1) {
  
          printmessage();
  
  
      }
      if (selected == 3) {
  
          cout &lt;&lt; "Current Settings" &lt;&lt; endl;
  
          somefunction();
      }
  
      else if (selected == 2) {
  
          cout &lt;&lt; "Starting Game..... " &lt;&lt; endl;
      }
  
      else if (selected == 4) {
  
          cout &lt;&lt; "Exiting....." &lt;&lt; endl;
          exit (3);
      }
  
      else {
  
          cout &lt;&lt; "Invalid Entry" &lt;&lt; endl;
          exit (3);
      }
  
      cout &lt;&lt; "Below is the Deck of cards and you will get to choose 5 cards to play with. Choose wisely." &lt;&lt; endl;
  
      return 0;
  
  };
  
  </code></pre>
  
  <p>So as you can see the user can see the menu, then if and else statements do the work. At the moment I have managed to loop the first menu select so if the user enters 1 it will print the message and then loop back to the menu. What I want is to also loop the 3 - current settings and if the user enters a invalid number. I've tried to accomplish it but I can't seem to do it. </p>