Delhi odd even please chk code

please check my code TEST CASE is FAILING
sample output is correct

my code ; https://ide.codingblocks.com/s/70709

Hii Nipun,
Your logic is wrong as in this question you have to find sum of digits at even place in a number and sum of digits at odd places in a number and you need to check is sum of digits at even places is divisible by 4 or sum of digits at odd places is divisible by 3. If yes, print yes else print no.

how to find the place of the digits in number

Hi Nipun

You need to find the digit at each individual place in the number and add it to the respective even / odd sum. And then check for possible conditions.

This is quite an easy question and shouldn’t be much of an issue.

Hint: For number n = 93, we can get the value of 3 by

int rem = n % 10; // rem = 3
n = n / 10; // n = 9

Similarly, we can 9 by

int rem2 = n % 10; // rem2 = 9

Try to understand from this. Hope this helps.

Hi Nipun

As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.