Answer Posted / siggi
class hcl
{
public static void main(String arg[])
{int a=0;
int b=1;
int i=1;
int x,y;
/*System.out.println("enter the no.");*/
x=Integer.parseInt(arg[0]);
if(x==0 || x==1)
{ System.out.println("yes it is");}
else {
do
{
y=a+b;
if(x==y)
{ System.out.println("yes it is");
i=0;}
else if(x>y)
{a=b;
b=y;}
else
{ i=0;
System.out.println("no it is not");}
}while(i!=0);
}
}
}
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Write a code to generate a series where the next element is the sum of last k terms.
Explain what is meant by 'bit masking'?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What are the different types of constants?
What is the use of gets and puts?
what is a constant pointer in C
Why is C language being considered a middle level language?
Explain what is dynamic data structure?
write a proram to reverse the string using switch case?
in iso what are the common technological language?
What are header files and explain what are its uses in c programming?
Where static variables are stored in memory in c?
What does 4d mean in c?
How to throw some light on the b tree?
Discuss the function of conditional operator, size of operator and comma operator with examples.