title: function in c++ that takes the month number and prints the number of days for the month
body: <p>the code worked before I added in the part where if the user enters in a number higher then 12 I want it to say "not a number for a month." im trying to get if and else to work but it just always stops the program im also new to programming sorry for bad format. Any help is good. thanks.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
  
  int month = 0;
  int days;
  
  cout &lt;&lt; "Month: ";
  cin &gt;&gt; month;
  
  if (month != 1 || month != 2 || month != 3 || month != 4 || month != 5 || 
      month != 6 || month != 7 || month != 8 || month != 9 || month != 10 || 
      month != 11 || month != 12 ) {
  
  cout&lt;&lt;"not a number for a month";
  
  return 0;
  
  }
  
  
  if (month == 4 || month == 6 || month == 9 || month == 11)
      days = 30;
  
  else 
  
  days = 31;
  
  cout &lt;&lt; days;
  
  return 0;
  }
  </code></pre>