Can anyone give me a hint? It is printing the correct numbers but it says odd is not calculated.
package com.codegym.task.task06.task0606;
import java.io.*;
/*
Even and odd digits
*/
public class Solution {
public static int even;
public static int odd;
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader n = new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(n.readLine());
for(int i = - 21678997;i< num ; i++) {
int a = num%10;
num = num /10;
if(a%2 == 0){
even ++;
} else if(a%2 !=0) {
odd ++;
}
}
System.out.println("Even: "+even+" Odd: "+odd);
}
}