Find the sum of all even integers between 2 and the input value ?

```
import java.util.Scanner;

public static void main(String[] args) {
    //initialization and declaration of variable
    int input, sum = 0;
    Scanner sc = new Scanner(System.in);

    //Ask user to input data
    System.out.print("Enter a number you want to limit up-to : ");
    input = sc.nextInt();

    //Conditions
    if(input < 2) {
        System.out.println("Error Occurred! Please, Enter a number greater or equal to 2. ");
    }

    for (int i = 2; i <= input; i++ ) {
        if( i % 2 == 0) {
            sum += i;
        }
    }
}

```