coding for Fibonacci.?
Answer / 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 |
Where we use clrscr in c?
What is a void pointer? When is a void pointer used?
Difference between Shallow copy and Deep copy?
What is an example of enumeration?
which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}
What is main () in c?
Are pointers integer?
what is c?
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?
why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?
Is multithreading possible in c?
What are the types of pointers?