Whst is the problem in this code y it is not running

public class DelhiOddEven {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();
	int i = 1;
	while (i <= n) {
		int a = scn.nextInt();
		int q = 0;
		int s = 0;
		while (a != 0) {
			int m = a % 10;
			s = s + m;
			q += 1;
			a = a / 10;
		}
		// System.out.println(s);
		if (s % 2 == 0 && s % 4 == 0 || s % 2 == 1 && s % 3 == 0)
			System.out.println("Yes");

		else
			System.out.println("No");

		i += 1;
	}

}

}

  • You have given a number and in that number, the digits which are even should have sum divisible by 4 or the sum of digits which are odd should be divisible by the 3, Only then you can say yes otherwise you will say no.
  • Declare two variables to store the sum of even numbers and odd numbers.
  • Extract digit one by one ( by % 10).
    1. Check if the number is even or odd.

    2. If even add the number in the variable storing even sum.

  1. Othewise add it in the variable storing odd sum.
  • After the loop, Check if the even sum is divisible by 4. ya the odd sum is divisible by 3.
    1. If True, print Yes.

    2. otherwise print No.

import java.util.*;

public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int i = 1;
while (i <= n) {
int a = scn.nextInt();
int q = 0;
int s = 0;
while (a != 0) {
int m = a % 10;
if(m%2==0)
s = s + m;
else
q += m;
a = a / 10;
}

		//System.out.println(s);
		if (s % 4 == 0 || q % 3 == 0)
			System.out.println("Yes");
		else
			System.out.println("No");
		i += 1;
	}
}

}