title: Code to display next day from assigned date
body: <p>I've been trying to write some code that gives me the next day from a date that has been gathered from user-input. here's my code.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
      int daysMonth(int iMonth)
  {
      if (iMonth &gt;= 1 &amp;&amp; iMonth &lt;= 12)
      {
        if (iMonth == 2)
          return 28;
  
        if (iMonth == 4 || iMonth == 6 || iMonth == 9 || iMonth == 11)
          return 30;
  
          return 31;
      }
      return 0;
  }
  
  void nextDay (int iD, int iMonth, int iY)
  {
      int daysM = daysMonth(iMonth);
  
              if (iD != daysM)
              {
                  iD = iD + 1;
                  iMonth = iMonth;
                  iY = iY;
              }
  
              if (iD == daysM)
              {
                  iD = 1;
                  iMonth = iMonth + 1;
                  iY = iY;
              }
  
              if ((iMonth == 12) &amp;&amp; (iD == 31));
              {
                  iD = 1;
                  iMonth = 1;
                  iY = iY + 1;
              }
  
      cout &lt;&lt; iD &lt;&lt; "-" &lt;&lt; iMonth &lt;&lt; "-" &lt;&lt; iY &lt;&lt; endl;
  }
  
  int main ()
  {
      int  iDay, iMonth, iYear;
  
          cout &lt;&lt; "Input day" &lt;&lt; endl;
          cin &gt;&gt; iDay;
  
          cout &lt;&lt; "Input Month" &lt;&lt; endl;
          cin &gt;&gt; iMonth;
  
          cout &lt;&lt; "Input Year" &lt;&lt; endl;
          cin &gt;&gt; iYear;
  
          if (iDay &gt;= 1 &amp;&amp; iDay &lt;= 31 &amp;&amp; iMonth &gt;= 1 &amp;&amp; iMonth &lt;= 12)
          {
              nextDay(iDay, iMonth, iYear);
          }
          else
              cout &lt;&lt; "Invalid date." &lt;&lt; endl;
  }
  </code></pre>
  
  <p>My problem is that every single date just adds another year, regardless of the date. I'm wondering if its the conditioning of the nextDay function.. Any help will be appreciated! Thanks!~</p>