Delhi odd even problem 1

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scn=new Scanner(System.in);
int x=scn.nextInt();
int rem,sum=0;
for(int i=1;i<=x;i++)
{ int n=scn.nextInt();
while(n!=0)
{
rem=n%10;
sum+=rem;
n=n/10;
}
if((sum%2==0)&&(sum/4==0)||(sum%2==1)&&(sum%3==0))
System.out.println(“yes”);
else
System.out.println(“no”);
}

}

}

check my code it run perfectly
but not get submitted

Your code is wrong because you’re supposed to find the sum of the digits which are even in the number and their sum should be divisible by 4 or sum of digits which are odd in the number should be divisible by 3. You have taken the sum of all the digits and then checked if the sum is even or odd.

for example : if number is 12345
then either 1+3+5 should by divisible by 3 or 2+4 should be divisible by 4

code is not running,shows nothing

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scn=new Scanner(System.in);
int x=scn.nextInt();
int rem,sum1=0,sum2=0;
for(int i=1;i<=x;i++)
{ int n=scn.nextInt();
while(n!=0)
{
rem=n%10;
int val=rem;
if(val%2==0)
{sum1=sum1+val;}
else
{sum2=sum2+val;}

n=n/10;

}

if((sum1%4==0)||(sum%3==0))
System.out.println(“yes”);
else
System.out.println(“no”);
}

}
}
check this ,but my code not get accapted,it show nothing when i run it, no error no statement ,it even not run

These need to be reinitialized for every test case.

Here second condition will have sum2 instead of sum

When I copy paste this code on ide.codingblocks.com, the print statements show some problem with the quotes. So maybe write these statements again and make sure the colour changes for the words in quotes. Also you have to print ‘Yes’ and ‘No’, first letter capital