Review my code and hint the solution

#include
using namespace std;

int main(){

int n;
cin>>n;

int count=0;
int no;
int even,odd;

while(count<n){
	cin>>no;


	while(no>0){

		int digit = no%10;
		no = no/10;

		if(digit%2==0){

			even = even + digit;
		}

		else{

			odd = odd + digit;
		}
	}
	count++;
}

if((even%4==0) or (odd%3==0)){

	cout<<"yes"<<endl;
}
else{

	cout<<"no"<<endl;
}

return 0;

}


code at ide

Output must be “Yes” or “No” instead of “yes” “no”. Please correct that and check.

there is something wrong in the code its only showing one - either yes or no

Match with the sample case and check now.

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.

Hey @rsumitaj
I see you’ve reopened this doubt
How can I help you ?


why here n-- is used
if i am using
int count=0
while(count<n)and then the same code and at last count++
then its not working

Hey @pratyush63
I checked with cnt and it worked
Here is the code https://ide.codingblocks.com/s/204842

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.