number 2 plssssss help !!....using array.. turbo c..

create a program that will accept a number and determine if
it is a happy number or an unhappy number..

example:

enter a number : 7



7*7=49

then 4 and 9

4*4 and 9*9== 16 + 18 gives you 97

then 9 and 7

9*9 and 7*7 == 81 + 49 gives you 130

then 1 and 3

1*1 and 3*3 == 1 + 9 gives you 10

1*1 gives you 1



sample output:



7= 49= 16+81= 97= 81+49=130 =1+9=10 =1


"7 is a happy number"





. if the last number is 2 then the number being inputed is
not a happy number.

Answer Posted / wqw

29

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by gets in c?

598


Why & is used in scanf in c?

612


How to Throw some light on the splay trees?

613


What is the meaning of 2d in c?

601


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

569






Can you assign a different address to an array tag?

691


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2259


how is the examination pattern?

1587


Can math operations be performed on a void pointer?

581


What is wrong with this statement? Myname = 'robin';

810


What is a floating point in c?

593


Explain what is dynamic data structure?

639


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3683


how to execute a program using if else condition and the output should enter number and the number is odd only...

1648


The statement, int(*x[]) () what does in indicate?

638