+ 1

Brain warm up

find out the digit sum using only while loop and nothing else eg the user write 16 then the output is 1+6=7, the user enters 10562 then the output come out to be 1+0+5+6+2=14

16th Jan 2018, 4:14 PM
saksham kumar sharma
saksham kumar sharma - avatar
3 odpowiedzi
+ 1
please make a code so that it can be runned
16th Jan 2018, 5:14 PM
saksham kumar sharma
saksham kumar sharma - avatar
0
number = 67387; sum=0; while(number>0): sum += int(number%10); number/=10; print(sum)
16th Jan 2018, 5:13 PM
Abhay Gawade
Abhay Gawade - avatar