Computer Science, asked by vermaneerj, 8 months ago

happy number program in bluej

Answers

Answered by ayushbag03
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 taesha43
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