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 |
writw a program to insert an element in the begning of a doubly linked list
How can I prevent another program from modifying part of a file that I am modifying?
What is the scope of static variables?
What does c mean before a date?
In the below code, how do you modify the value 'a' and print in the function. You'll be allowed to add code only inside the called function. main() { int a=5; function(); // no parameters should be passed } function() { /* add code here to modify the value of and print here */ }
How can I get back to the interactive keyboard if stdin is redirected?
being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?
advantages of pointers?
Why do we use pointer to pointer in c?
do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.
Is swift based on c?
What is an object?