+ 1

WAP to check whether a number is disarium or not

A number is said to be disarium if it's continuous sum of its digit is one

19th Mar 2018, 10:40 AM
Arnabh Sinha
Arnabh Sinha - avatar
2 Antworten
+ 11
edit : I found a thread on that , but completely different & very easy than that https://www.sololearn.com/Discuss/793235/?ref=app 👉btw , here is the soln for abv. problem 1)U will need a recursion for that [in recursion U will calculate sum if digits] & then give it a as a parameter for next iteration until number of digits left will be 1 ... ie n/10=0 //game will be over in 3 lines
19th Mar 2018, 1:26 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 1
I am not actually sure abt it .for eg 55 5+5=10&1+0=1 so it's disarium number
19th Mar 2018, 3:53 PM
Arnabh Sinha
Arnabh Sinha - avatar