title: Leap Year C Programme
body: <p>I want to write a C Code where user could give a 4 Digit Year number like :2018
  The programm will say if its leap or not leap year. But i want to add another step.
  Ex: if 2019 is not the leap year the programm shoudl tell me which year is next leap year.</p>
  <pre><code>#include &lt;stdio.h&gt;
  int main() {
     int year;
     printf(&quot;Enter a year: &quot;);
     scanf(&quot;%d&quot;, &amp;year);
     // leap year if perfectly visible by 400
     if (year % 400 == 0) {
        printf(&quot;%d is a leap year.&quot;, year);
     }
     // not a leap year if visible by 100
     // but not divisible by 400
     else if (year % 100 == 0) {
        printf(&quot;%d is not a leap year.\n&quot;, year);
     }
     // leap year if not divisible by 100
     // but divisible by 4
     else if (year % 4 == 0) {
        printf(&quot;%d is a leap year.\n&quot;, year);
     }
     // all other years are not leap year
     else {
        printf(&quot;%d is not a leap year.\n&quot;, year);
     }
     year+=1;
     printf(&quot;%d is the next leap year:\n&quot;, year);
  
        return 0;
  }
  </code></pre>