

InterviewSolution
Saved Bookmarks
1. |
23 A Happy Word' is defined asTake a wond and caleulate the word's value based on position of the letters in Engtalphabet On the basis of word 's value, find the sum of the squares of its digits Repthe process with the resultant number until the number equals 1 (one). If the numnds with 1 then it is called a Happy Word. Write a program to input a wordcheck whether it a Happy Word' or not. The program displays a messige accordinSample Input VATPlace value of V tt 22A#1,T:20Sample Output A Happy Word |
Answer» <p>V=22A=1T=20</p><p>now according to given condition 22120 = 4+4+1+4+0=13 = 1+9 =10 = 1+0 =1 hence VAT is a 'happy word'</p> | |