Due to an immense rise in Pollution, Kejriwal is back with the Odd and Even Rule in Delhi. The scheme is as follows, each car will be allowed to run on Sunday if the sum of digits which are even is divisible by 4 or sum of digits which are odd in that number is divisible by 3. However to check every car for the above criteria can’t be done by the Delhi Police. You need to help Delhi Police by finding out if a car numbered N will be allowed to run on Sunday?
Not getting desired output
@moksh hey what are you doing in while loop not able to understand . share your code through coding blocks ide as it is easy to debug if there is any error.
@moksh hey your not inputting number of test cases and also your logic to find number of digits is also wrong.
@moksh also for example
take n = 12345
so sum of digits = 15
and 15 is odd and is divisble by 3 so the output is “yes”.
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.
