Test case fail kindly check the code

import java.util.*;
public class Main {
public static void main(String args[]) {
int n;
Scanner sc = new Scanner(System.in);
n=sc.nextInt();
int k;
int sum=0;
int rem=0;
for(int i=1; i<=n ; i++){
k=sc.nextInt();
while(k>0){
rem=k%10;
sum=sum+rem;
k=k/10;
}
if(sum%2 == 0){
if(sum%4 == 0)
System.out.println(“Yes”);
else
System.out.println(“No”);
}
else {
if(sum%3 == 0)
System.out.println(“Yes”);
else
System.out.println(“No”);
}
sum=0;
rem=0;
}
}
}

Hi Ishant,
See in this question you have to maintain two sum, one sum is of all the even digits present in the number and other is sum of all the odd digits present in the number. Then if sum of even digits is divisible by 4 or sum of odd digits is divisible by 3 then print ‘Yes’ else print ‘No’.

Hi Ishant
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.