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 |
Write the control statements in C language
What is the right way to use errno?
input any 4 digit number and find the difference of all the digits?
write the program for maximum of the following numbers? 122,198,290,71,143,325,98
What is structure padding & expalain wid example what is bit wise structure?
What is %g in c?
main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }
What is the difference between near, far and huge pointers?
whenever a question is posted in a particular category in allinterview.com, Is there any facility to receive an indication mail. For eg: I need to receive an indication email, whenever a question is posted under the category “C Langauage”.
What does sizeof int return?
What is n in c?
Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.