3 test cases failed
Armstrong number
@AjayRRJ in your first while loop you make num=0, then again in second while loop you are checking till num=0 but num is already 0 so you will never enter in second while loop and sum will not get updated and will be 0. Hence your code is always printing true since sum and num both are 0.
and for second while loop take a different variable to store remainder, do not update it in num.
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.