Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

coding for Fibonacci.?

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


Please Help Members By Posting Answers For Below Questions

Differentiate between null and void pointers.

1180


What’s a signal? Explain what do I use signals for?

1117


What is character constants?

1191


Why main function is special give two reasons?

1551


What is difference between structure and union in c?

995


What is a function simple definition?

1103


Do you know the purpose of 'register' keyword?

1023


What are the two forms of #include directive?

1171


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

1105


c program for searching a student details among 10 student details

2093


Sir i need notes for structure,functions,pointers in c language can you help me please

2426


What is the difference between functions abs() and fabs()?

1160


What is a program flowchart and how does it help in writing a program?

1148


How can I delete a file?

1071


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2846