Delhi's odd even

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int e = 0;
int o = 0;
int r ;

	while( n!=0){
		int a = scn.nextInt();
		while( a != 0){
		r = a % 10;
		if( r%2 == 0){
			e = e*10 + r;
		}else{
			o = o*10 + r;
		}
		 a = a / 10;
		}
		if( e%4 == 0 || o%3 == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
		n = n-1;

	}


}

}

hi @asthaaggarwal2
you just need to add the digits not to form a number with that digits
in short just do this

e=e+r;
else{
o=o+r
};

1 Like

@asthaaggarwal2
please mark your doubt as resolved in my doubt section and rate me as well. :blush::blush::blush:

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int e = 0;
int o = 0;
int r ;

	while( n!=0){
		int a = scn.nextInt();
		while( a != 0){
		r = a % 10;
		if( r%2 == 0){
			e = e + r;
		}else{
			o = o + r;
		}
		 a = a / 10;
		}
		if( e%4 == 0 || o%3 == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
		n = n-1;

	}


}

}

@asthaaggarwal2
what your doubt now?

you have to initialize e and o in the outer while loop for the correct answer.