Delhi's odd even

Why this question shows the wrong answer?

@S19LPPP0009
Hello shubham ,
please save ur code at coding blocks ide and share the link here

@S19LPPP0009
also read this carefully

Hey @S19LPPP0009 there were couple of mistakes in your code

  1. in a while loop you dont need to subtract n each time, so no need to write n–
  2. you need to make y and z zero instead of x and y
    Here is link of your code with mistakes rectified
    https://ide.codingblocks.com/s/181790

Yeah,done Thanks, BTW why don’t we not need to do n-- ?

because we are already dividing n by 10, subtracting one makes no sense.

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.