compute the nth mumber in the fibonacci sequence?

Answer Posted / sweety

main()
{ int a=0,b=1,c,n,i;
printf("enter nth number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
c=a+b;
printf("fibonacci series is %d",&c);
a=b;
b=c;
}
getch();
}

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give basis knowledge of web designing ...

1583


Is multithreading possible in c?

573


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

926


What is the code for 3 questions and answer check in VisualBasic.Net?

1696


What is the difference between malloc() and calloc()?

621






What are logical errors and how does it differ from syntax errors?

667


What is meant by operator precedence?

684


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

727


What is getch () for?

683


Explain what are compound statements?

612


design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1501


program to convert a integer to string in c language'

1990


Do pointers need to be initialized?

571


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

1685


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

1731