Recursion:
In C, it is possible for the functions to call themselves. A function is called 'recursive' if a statement within the body of a function calls the same function. Sometimes called 'circular definition', recursion is thus the process of defining something in terms of itself.
Program:
#include<stdio.h>
#include<conio.h>
void fibo(int n);
main()
{
int n;
clrscr();
printf("Enter range ");
scanf("%d",&n);
printf("\n0 1 ");
fibo(n);
getch();
}
void fibo(int n)
{
static int a=0,b=1,c;
if(n>2)
{
c=a+b;
a=b;
b=c;
printf("%d ",c);
fibo(n-1);
}
}
output:
0 1 1 2 3 5 8 13 21 34