Java: Filtering out user input using nextInt()
<p>I am making a program where the user enters their mark, if they enter over 100 then the program stops, however I can't seem to stop the value over 100 also being assigned to the Marks variable...</p>

<pre><code>Scanner scan = new Scanner(System.in);
Int Marks = 0;

while (Marks &gt;= 0 &amp;&amp; Marks &lt;= 100) {
        System.out.println("Enter Students Test Marks Here");

        Marks = input.nextInt();
}

// Output Test
System.out.println("The Marks variable value is " +Marks);
</code></pre>
