1. I'm not sure how to grab one digit from an integer.
2. I don't know how to grab the next digit from the integer.
3. I'm not sure when to stop my loop.
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 reader = new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(reader.readLine());
while (num > 0 ) {
if (num % 2 == 0) {
even++;
} else if (num % 2 > 0) {
odd++;
}
break;
}
System.out.println("Even: " + even + " Odd: " + odd);
}
}