answersLogoWhite

0

#include<stdio.h>

void printFibonacci(int);

int main(){

int k,n;

long int i=0,j=1,f;

printf("Enter the range of the Fibonacci series: ");

scanf("%d",&n);

printf("Fibonacci Series: ");

printf("%d %d ",0,1);

printFibonacci(n);

return 0;

}

void printFibonacci(int n){

static long int first=0,second=1,sum;

if(n>0){

sum = first + second;

first = second;

second = sum;

printf("%ld ",sum);

printFibonacci(n-1);

}

}

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

How do you write prime number program in C language?

[ Fibonacci series___: ] #include&lt;stdio.h&gt; int main(void) { int n,i,c,a=0,b=1; printf("Enter Fibonacci series of nth term : "); scanf("%d",&amp;n); printf("%d %d ",a,b); for(i=0;i&lt;=(n-3);i++) { c=a+b; a=b; b=c; printf("%d ",c); } }


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

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


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(); }


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

i dn't know. haha


When and what are the symbols used in the flowchart for the program for the calculation of average numbers in C language?

Look up "Flowchart" in wikepedia, most of what you need to know can be found there. Get a flow chart symbol template and a sheet of paper and you are on your way.


Hcf flowchart of c?

sfafa


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.


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?


Program for sin series in c language?

find the program in c-pgms.blogspot.com


Write a Fibonacci function then takes an input from the user in main program and pass to function which prints Fibonacci series up to this number in c language by using while statement?

#include#includevoid fibonacci(int x){int f=0,m=-1,n=1,i=0;while(i


Flowchart to show the greatest among a, b, c?

A