Leaper if expression is faulty
<pre><code>import java.util.*;

public class LeapYear {

    public static void main (String args[]) {

        Scanner scan = new Scanner(System.in);
        int userInput = scan.nextInt();
        boolean leapYearisTrue = false;

        while ( userInput != 0 ) {
            if (userInput % 4 == 0) {
                if ( (userInput % 100 == 0) &amp;&amp; (userInput % 400 != 0) ) {
                    leapYearisTrue = false;
                    System.out.println (leapYearisTrue);
                }
                else {
                    leapYearisTrue = true;
                    System.out.println (leapYearisTrue);
                }
                userInput = scan.nextInt();
            }
        }
    }
}
</code></pre>

<p>Whenever I input a value that IS a leap year, the program runs smoothly and does what it's supposed to: </p>

<pre><code>2000
true
1960
true
400
true
</code></pre>

<p>but whenever I input a non-leap year, it doesn't print false and would no longer print that a number is a leap year: </p>

<pre><code>403
400
2000 ( this is a leap year , yet it doesn't print true)
2004
</code></pre>