answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

int fib(int a);

main()

{

int a;

clrscr();

scanf("%d",&a);

for(int i=0;i<a;i++)

printf("%d\n",fib(i));

}

int fib(int a)

{

if(a==0)

return 0;

if(a==1)

return 1;

else

return (fib(a-1)+fib(a-2));

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is Fibonacci heaps algorithm?

fibonacci heap is a heap


How do you calculate the nth term in the Fibonacci sequence using C?

what? Assuming you wanted an algorithm to find the nth number in the Fibonacci sequence: double Fib(int i) { double x = 1; double y = 1; if (i


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Examples of algorithms?

bisection algorithm (see link)Euclid's algorithm (see link)Fibonacci search (see link)


Write a program using while loop that generates Fabonaci series up to 200?

//to generate Fibonacci series upto a range of 200....(in C).... #include&lt;stdio.h&gt; main() { int a,b,c,i; a=0; b=1; printf("\n FIBONACCI SERIES .....\t"); i=1; while(i&lt;=(200-2)) { c=a+b; printf("\t%d",c); a=b; b=c; i++; } }


C orogram for Fibonacci series?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { printf("The first 20numbers of Fibonacci series are:"); int a=0, b=1, c, n=2; printf("%d \t, %d", &amp;a, &amp;b); while(n&lt;20) { c=a+b; printf("\t %d", &amp;c); a=b; b=c; n++; } getch(); }


Is 20 a Fibonacci number?

20 is not a term in the Fibonacci series.


Program to generate Fibonacci series using storage class in c plus plus?

i dn't know. haha


Fibonacci series program in vb.net?

This is not a homework board. I will give you a rough algorithm in C#int firstnum= 1;int finalnum = 1;int nextNumber;System.Console.Write(finalnum + " ");while (finalnum < 50){System.Console.Write(finalnum + " ");nextNumber = finalnum + firstnum;firstnum= finalnum ;finalnum = nextNumber;}


Can you explain the program of Fibonacci series in c?

You mean you have written a program, but you don't understand it? Well, how could I explain it without seeing it?


Can you have the program in C plus plus for recursive function generating a series of terms?

Yes, this can be done. For example for Fibonacci series. You will find plenty of examples if you google for the types of series you need to be generated.


Who invent sEquence and series?

Fibonacci!