my whole code is correct but it is showing wrong output for particular test cases please help
Test cases problem in Delhis odd even
#include
using namespace std;
int main()
{
int n;
cin >> n;
int se = 0;
int so = 0;
while(n>0)
{
int no;
cin >> no;
while (no > 0)
{
int last_digit = no % 10;
if (last_digit % 2 == 0)
{
se = se + last_digit;
}
else
{
so = so + last_digit;
}
no = no / 10;
}
n–;
if (se % 4 == 0 || so%3==0 )
{
cout << “Yes” << endl;
}
else
{
cout << “NO” << endl;
}
}
return 0;
}
hey @Amzad-Choudhary-353751958569219 you need to make se and so zero before each test case, other than that your code is fine.
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.