when i tried to implement the logic of this problem, it is showing incorrect output as it returns 1 for every positive integer which i have used as an input . please tell me where am i going wrong ?
Incorrect output in armstrong no problem

here u are updating the value of n
u run the while loop until n == 0 and then u initialise sum = 0
and the if conditiion u are using
if( n == sum)
so since both are alawys 0 it comes about to be true
Correction: instead of directly updating n take it in another variable and then do the operations
1 Like
ya thanks i got the output . 
1 Like
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.