Please tell the mistake in my code …
Delhi's odd even
@G_rahil hey grahil you have to maintain two variable sume and sumo which store the even and odd number present in the numbers
for ex
982452
then maintain 2 variables evesum=0, oddsum = 0 ;
and they will be:
9 + 8 + 2 + 4 + 5 + 2
evesum = 8 + 2 + 4 + 2 = 16
oddsum = 9 + 5 = 14
if((evesum%4==0)||(oddsum%3==0)){
cout<<“Yes”<<endl;
}else{
cout<<“No”<<endl;
}
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.