What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

C/C++ Lab Program(s)/Materials

C Program for fibanacci series using recursion.

#include<stdio.h>
#include<conio.h>
int fib(int);
void main()
{
int a,b,i,c;
clrscr();
printf("Enter the N value");
scanf("%d",&a);
for(i=0;i<a;i++)
{
printf("\n%d",fib(i));
}
getch();
}
int fib(int x)
{
if(x==0)
return(0);
if(x<=1)
{
return(1);
}
else
{
return(fib(x-1)+(fib(x-2)));
}
}

More Lab Programs with Answers -Given Below-Click and Get Freely

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com