0

Write a program in JAVA to check whether a number is a happy number or not.

a happy number is one in which the sum of the square of the digits is equal to 1.

31st Dec 2017, 8:30 AM
Alok Agarwal
Alok Agarwal - avatar
3 odpowiedzi
+ 7
@blackcat that is true, I did not think of that
31st Dec 2017, 10:46 AM
David Akhihiero
David Akhihiero - avatar
+ 6
Looks like the only happy number is 1
31st Dec 2017, 10:23 AM
David Akhihiero
David Akhihiero - avatar
+ 3
@Yerucham By @Alok Agarwal's definition, all powers of ten greater than one are happy too.
31st Dec 2017, 10:29 AM
blackcat1111
blackcat1111 - avatar