C Program for Fibonacci Series using Functions

#include<stdio.h>
int fibo(int n)
{
int n,m,sum,i;
i=1;
n=0;
m=1;
while(i<=1)
{

sum=n+m;
n=m;
m=sum;
i++;
printf("\n%d",sum);
}
return(sum);
}
void main()
int n,i;
printf("\n enter the size\n");
scanf("%d",&n);
i=fibo(n);
printf("\nthe %dth fibonacci number is %d",n,i);
getch();
clrscr();
}

Comments

Popular posts from this blog

Visti Cloud Service (VCS)

Being a DARK SKINNED is not a PROBLEM