How to sum all the numbers that I entered in the console : So my code looks like this  
  

<import java.util.Scanner;
public class homework3 {

	public static void main(String[] args) {
		
		System.out.println("Enter a positive number: ");
	    Scanner scan = new Scanner(System.in);
	    int i = scan.nextInt();
	     int y = 1;
	     int sum = 0;
	     
	     
	    
	     
	     int e = 2;
	     while (e <=i ) {
	       System.out.print(" " + e);
	       e += 2;
	     }
	    
	}

}
>
I'm trying to sum all of the numbers that go up to the number that's entered.