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
What is the sizeof () operator?
Explain is it better to bitshift a value than to multiply by 2?
Explain what is the difference between functions getch() and getche()?
What is header file in c?
What is a pointer and how it is initialized?
What is the difference between int main and void main in c?
What is the purpose of the preprocessor directive error?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Why does everyone say not to use scanf? What should I use instead?
What is the explanation for modular programming?
Why is c used in embedded systems?
What is switch in c?
What is anagram in c?
What is getch?
Can we use visual studio for c?