Can somebody explain why the last condition is not met although the output text and result are exactly the same as in the example output?
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 {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
if (a < 0)
{
a *= -1;
}
for (int i = 1; i < a; i *= 10) {
int m = a/i;
if ((m % 2) == 0)
even++;
else
odd++;
}
System.out.print("Even:" + " " + even + " " + "Odd:" + " " + odd);
}
}