unable to solve the task properly
<p>I am using eclipse as an Ide. I tried to do the source code for the following task: </p>

<blockquote>
  <p>"Write an algorithm to prompt the user to enter a series of integers (each on a separate line). The input is to be terminated with the value zero. Once the user has entered zero, display the number (count) of negative and positive values.": </p>
</blockquote>

<p>This is my source code if anyone have any ideas or suggestions I would be gratefull to hear them.Thank you.  </p>

<pre><code>import java.util.Scanner; 

public class CountNums {    

    public static void main(String[] args) {
        Scanner input = new Scanner (System.in);        
        System.out.println("Enter a series of integers and 0 for exit of the loop:");       
        int i = input.nextInt();        
        int negative = 0;       
        int positive = 0 ;          
        while (i != 0 ) {
            System.out.println("Enter next integer: ");
            i = input.nextInt();        
            if (i &lt; 0) {
                System.out.println( negative += 1 );
            }else if (i &gt; 0)  {
                System.out.println(positive += 1);          
            }
        }   
    } 

}
</code></pre>
