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

Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2187


Where local variables are stored in c?

997


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1270


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

5461


What is chain pointer in c?

1058


What is the difference between if else and switchstatement

1926


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1236


what is recursion in C

1060


What is NULL pointer?

1086


State the difference between realloc and free.

1068


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

1109


What are the application of void data type in c?

1187


Explain what are the advantages and disadvantages of a heap?

1085


What is c++ used for today?

1106


Who invented b language?

1403