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

What are dangling pointers? How are dangling pointers different from memory leaks?

1390


What are the properties of union in c?

1111


what do you mean by inline function in C?

1100


what is the different bitween abap and abap-hr?

2422


What is difference between arrays and pointers?

1151


Write a program to identify if a given binary tree is balanced or not.

1229


write a programming in c to find the sum of all elements in an array through function.

2220


When the macros gets expanded?

1484


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

1306


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1304


if p is a string contained in a string?

1891


What is the purpose of main( ) in c language?

1186


What does calloc stand for?

1242


Explain the red-black trees?

1199


What is the difference between Printf(..) and sprint(...) ?

1634