program to find fibonacci

program to find fibonacci

#include<stdio.h>
void main()
{
long x,y,z;
int i,n;
x=0;
y=1;
printf("Enter the no. : ");
scanf("%d",&n);
printf("%ld",y);
for(i=0;i<n;i++)
{
z=x+y;
printf("%ld",z);
x=y;
y=z;
           printf("\t");
}
printf("\n");
}

out put:-

 

No comments:

hia friends you are seeing my blogger thank's. Powered by Blogger.