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
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Write a program to print numbers from 1 to 100 without using loop in c?
Write a program to print fibonacci series without using recursion?
What is the difference between array and structure in c?
What is the difference between array_name and &array_name?
How can you tell whether two strings are the same?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
write a progrmm in c language take user interface generate table using for loop?
How can you determine the maximum value that a numeric variable can hold?
What is a char in c?
What are pointers?
What is binary tree in c?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
How can I recover the file name given an open stream or file descriptor?