Please check my code logic is right but it is not giving right answer

my code:
https://ide.codingblocks.com/s/71039

when you will come out of while loop n will have value 0 and not the value of original number…so capture the value of n before while loop in some variable…after while loop ends compare ans with that variable…

1 Like

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.