title: How to loop through all the values in an array in C language?
body: <pre><code>int myd;
     int mym;
     int myy;
     printf(&quot;Enter your day of birth:&quot;);
     scanf(&quot;%d&quot;, &amp;myd);
     printf(&quot;Enter your month of birth:&quot;);
     scanf(&quot;%d&quot;, &amp;mym);
     printf(&quot;Enter your year of birth:&quot;);
     scanf(&quot;%d&quot;, &amp;myy);
  
     int month [12] = {1,2,3,4,5,6,7,8,9,10,11,12};
     if (mym == 1 || mym == 3 || mym == 5 || mym == 7 || mym == 8 || mym == 10 || mym == 12){month [0,2,4,6,7,9,11]= 31;}
     else if (mym == 4 || mym == 6 || mym == 9 || mym == 11){month [3,10,8,5]= 30;}
     else if (mym == 2 &amp;&amp; myy %4 !=0 &amp;&amp; myy %100 ==0){month [1] = 28;}
     else if (mym == 2 &amp;&amp; myy %4 ==0 &amp;&amp; myy %100 !=0){month [1] = 29;}
  
     while (month &lt; mym){
     int inc;
     inc = month++;
     printf (&quot;%d&quot;, inc + myd);
     }
  </code></pre>
  <p>I get an error for inc = month++ because there isn't an l value for increment operand. I got what that means but how can I write the while loop so that it loops through all the values in the array?
  I'm trying to find the number of days until someone's birthdate from the beginning of their birth year.</p>