happy number program in bluej
Answers
Answered by
2
Code Explanation :
Calculate the square of each digit present in the inputNumber. Add it to a variable digitsSum. If the resulting value of digitsSum is 1 then the input number is happy number. Else the number is unhappy number.
Answered by
3
Answer:
The happy number can be defined as a number which will yield 1 when it is replaced by the sum of the square of its digits repeatedly. If this process results in an endless cycle of numbers containing 4, then the number is called an unhappy number.she
Similar questions