i did all the code all by my own exept for the condition of the while in my head was input %10 ==0 , and he line 29, that i find out here in the community but really i can't get what is it.
if someone could explain to me why the while loop is (n>0) and line 29 will be great
package com.codegym.task.task06.task0606;
import java.io.*;
import java.util.*;
/*
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
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int i =0;
while (n> 0){
i = n % 10;
if (i % 2 ==0){
even++;
} else if (i % 2 != 0) {
odd++;
}
n /= 10;
}
System.out.println("Even: " + even + " Odd: " + odd);
}
}