Скачать
A python program to find the sum of digits of a given number using while loop
Автор: Recursive Coding
Загружено: 2025-06-20
Просмотров: 32
Описание:
The algorithm behind this program is:
Take two variables, one to store the number and other to store the sum value.
Make 0 as the initial value of the variable used in the program to store the sum.
a. Obtain the last digit(remainder) of the given number by dividing it by 10, i.e, num % 10
b. After obtaining the last digit, add it to the current sum value.
c. Divide the number by 10 to extract the remaining number
Repeat the process a, b and c as long as the number is not equal to zero. When the loop ends the final value of sum is obtained.
Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: