Question: Please answer in C++ 1 Happy numbers A happy number is a natural number (non-negative integer) that eventually becomes 1 when iterated over the sum

Please answer in C++
1 Happy numbers A happy number is a natural number (non-negative integer) that eventually becomes 1 when iterated over the sum of squared digits function. For example, 28 is happy: 28 +22 +82 = 68 +62 +82 = 100+ 11 +02 + 02 = 1 V But 4 is unhappy (omitting intermediate results), as the chain of numbers led to the original number. 4 + 16 + 37 58 89 145 + 42 420 +4+... In fact, every unhappy positive number eventually converges with 4. Write a function bool isHappy (unsigned int n) that receives as an argument a non- negative integer n and returns true if n is happy. Examples: isHappy (4) returns false. isHappy (13) returns true. isHappy (28) returns true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
