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 |
Is c functional or procedural?
define string ?
Explain continue keyword in c
What is array of pointers to string?
print the table 5 in loops
What is the scope of global variable in c?
What is a pragma?
why you will give me a job in TCS.
What is "Duff's Device"?
What are static variables, and where are they stored?
Do variables need to be initialized?
What is Dynamic Initialization.