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
What is meant by gets in c?
Why & is used in scanf in c?
How to Throw some light on the splay trees?
What is the meaning of 2d in c?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
Can you assign a different address to an array tag?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
how is the examination pattern?
Can math operations be performed on a void pointer?
What is wrong with this statement? Myname = 'robin';
What is a floating point in c?
Explain what is dynamic data structure?
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.
how to execute a program using if else condition and the output should enter number and the number is odd only...
The statement, int(*x[]) () what does in indicate?