\* C Program using function to Display Fibonacci Sequence *\
# include < stdio.h >
# include < conio.h >
int fibonaci(int, int, int) ;
int main( )
{
int n, f1, f2, f = 0, i = 2 ;
printf(" Enter the last term of fibonaci series : ") ;
scanf("%d", &n) ;
f1 = 0 ;
f2 = 1 ;
printf("\n Fibonacci Series are : \n %d\t %d \t ", f1, f2 ) ;
fibonaci(f1, f2, n);
return (0) ;
}
int fibonaci( int f1, int f2, int n )
{
int f ;
do
{
f = f1 + f2 ;
if( f <= n )
{
printf( "%d\t", f ) ;
f1 = f2 ;
f2 = f ;
}
}
while(f <= n);
return (0) ;
}