+ 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
2 odpowiedzi
+ 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
+ 1
I am not actually sure abt it .for eg 55 5+5=10&1+0=1 so it's disarium number