title: Print out contents of a list human readable C#
body: <p>I am very new to C# and I would like to print out the contents of a list so that the information stored in seatsBooked will be displayed for the user if they pick the number 3 case of my switch statement. My code is as follows:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace AirlineReservation
  
  {
  class Program
  {
      static void Main(string[] args)
      {
          Random rand = new Random();
          bool[] seats = new bool[10];
          //To keep a separate list of seats taken          
          List&lt;int&gt; seatsBooked = new List&lt;int&gt;();
          int inputI = 0;
          char inputC = ' ';
          bool quit = false;
          do
          {
              Console.Clear();
              int assignSeat = rand.Next(5, 10);
              Console.WriteLine("Thanks for flying with Steve-O Airlines" + "\n" + '\n' +
                               "\nPlease enter the number one [1] for First Class" +
                               " \nPlease enter the number two [2] for Economy" +
                               "\nPlease enter the number three [3] for seats taken" +
                                "\nPlease enter the number four [4] to exit the order system");
              inputI = Int32.Parse(Console.ReadLine());
              switch (inputI)
              {
                  case 1: //is the seat booked, if not book it
                      int assignedSeat;
                      if (seatsBooked.Count == 0) 
                      {
                          assignedSeat = rand.Next(0, 5);
                          seats[assignedSeat] = true;
                          seatsBooked.Add(assignedSeat);                            
                      }
                      else
                      {
  
                          do //while there are available seats and current seat has not being assigned before.
                          {
                              assignedSeat = rand.Next(0, 5);
                              if (!seatsBooked.Contains(assignedSeat)) //if assignedSeat is not booked.
                              {
                                  seats[assignedSeat] = true;
  
                              }
                              //repeat while the random seat number is already booked and there are  avaialable seats
                          } while (seatsBooked.Contains(assignedSeat) &amp;&amp; seatsBooked.Count &lt; 5);
  
                          if (seatsBooked.Count &lt; 5) //if seatsBooked list is not full for First Class
                          {
                              seatsBooked.Add(assignedSeat); //Add current random-generated seat to the list.
                          }
  
                      }
  
                      if (seatsBooked.Count &gt;= 5)
                      {
                          Console.WriteLine("All seats for First Class are booked! Looks like a bad lunch for you.");
                          Console.WriteLine("Press enter to continue...");
  
                      }
                      else
                      {
                          Console.WriteLine("Your seat number is: {0}" + " \nNow pay me $550", assignedSeat + 1);
                          Console.WriteLine("Press enter to continue...");
  
                      }
                      Console.ReadLine();
                      break;
                  case 2:
                      seats[assignSeat] = true;
                      Console.WriteLine("Your seat number is: {0}"+ " \nNow pay me $350", assignSeat + 1);
                      Console.WriteLine("Press enter to continue...");
                      Console.ReadLine();
                      break;
                  case 3:
  
                          Console.WriteLine(seatsBooked);  
  
  
  
                      break;
                  case 4:
                      quit = true;
                      break;
                  default:
                      Console.WriteLine("ERROR::INVALID SELECTION" +
                          "\nYou will not get a flight this way!" );
                      quit = true;
                      break;
              }
          } while (!quit);
  
  
      }
  }
  </code></pre>
  
  <p>}</p>