sum of the digits of a given number Vishnuprasad AS 15:05 Python algorithm : Step 1: Input N Step 2: Sum = 0 Step 3: While (N != 0) Rem = N % 10; Sum = Sum + Rem; N = N / 10; Step 4: Print Sum Share on Facebook Share on Twitter Share on Google Plus About Vishnuprasad AS This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel. RELATED POSTS Number of vowelsFibonacci SeriesBill Gates explains If statements
0 comments:
Post a Comment