I become an error on line 16 because "the variable wasn't initialised". Help me pls.
package en.codegym.task.pro.task04.task0408;
import java.util.Scanner;
/*
Maximum of entered numbers
*/
public class Solution {
public static void main(String[] args) {
//write your code here
Scanner sc = new Scanner(System.in);
int max = 0;
int input = 0;
while (true) {
if (sc.hasNextInt()) {
input = sc.nextInt();
max=(input%2==0&&input>max)?input:max;
}else{
break;
}
}
}
}