Here is one question which one of my students, Vedant Sahai asked me. It appeared in his computer subject exam of his recent ICSE X exam (Mumbai):

**write a program to accept a number from the user, and check if the number is a happy number or not; and the program has to display a message accordingly:**

**A Happy Number is defined as follows: take a positive number and replace the number by the sum of the squares of its digits. Repeat the process until the number equals 1 (one). If the number ends with 1, then it is called a happy number.**

For example: 31

Solution : 31 replaced by and 10 replaced by .

*So, are you really happy? 🙂 🙂 🙂*

*Cheers,*

Nalin Pithwa.

### Like this:

Like Loading...

*Related*

In Hindi “Harsha” means “happiness”. And D. R. Kaprekar defined Harshad Numbers as the number which is divisible by its sum of digits. Wiki: https://en.wikipedia.org/wiki/Harshad_number

LikeLike

Oh….this certainly is “composition of happinesses” ! ha…ha…ha…lol…thanks a lot …

LikeLike