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
Can a pointer be volatile in c?
What is pass by reference in c?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
How can you read a directory in a C program?
Can we use visual studio for c?
Which header file is essential for using strcmp function?
How can I sort more data than will fit in memory?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
ATM machine and railway reservation class/object diagram
What is the purpose of realloc()?
How do we make a global variable accessible across files? Explain the extern keyword?
Explain how can I write functions that take a variable number of arguments?
What are the 32 keywords in c?
What is strcpy() function?
How can I read a binary data file properly?