As I was able to solve the case with the help section but I am still figuring out why I would use "z%10" and then divide it by 10 in the if/else loop.
while (z > 0){
           x = z%10;
           if (x%2 == 0){
               gerade++;
               z = z/10;
           }
           else if (x%2 != 0){
               ungerade++;
               z = z/10;
           }
       }