Why my test cases are failed here?

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int evensum=0;
int oddsum=0;
int temp = n;
while(temp>0){
int lastdig=temp%10;
if(lastdig%2==0){
evensum+=lastdig;
}
else{
oddsum+=lastdig;
}

		temp=temp/10;
	}
	if(evensum%4==0 || oddsum%3==0){
			System.out.println("Yes");
		}
		else{
			System.out.println("No");
		}
	
}
}

@LakshmiPrasanna0303 due to endline this code run multiple time I guess

so as you can see in the problem statement, you have to check the criteria for multiple cars. the problem is, you are just checking for a single car. your code is fine but you must check how the inputs are provided to you. first input is no of test cases say N, followed by N lines and you need to print “yes” or “no” for these N lines.

Thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.