+ 1
What is wrong with my code? Please help.
I made a C programme to find out sum of digits of a given number, but failed to get desired result. It's output is too long. https://code.sololearn.com/cg52o0JzHdui/?ref=app
3 Answers
+ 1
In the last statment of while loop, it should be a=a/10 instead of a=a%10 and put the print statement outside while loop, hope it helps.
+ 1
Yes, now it's working correctly. Thanks for helping me.
+ 1
Happy to help đ