/* ******** program in c for Fibonacci series********* */
#include<stdio.h>
#include<conio.h>
main()
{
int a=1,b=1;
int n, c=0;
printf("enter the range of fibinnocci series to enter\n");
scanf("%d",&range);
printf(" The fibinocci series is");
printf("\n%d %d ",a,b);
while(c<=range)
{
c=b+a;
a=b;
b=c;
printf("%d" %d ",a,b);
}
}
#include<stdio.h>
#include<conio.h>
main()
{
int a=1,b=1;
int n, c=0;
printf("enter the range of fibinnocci series to enter\n");
scanf("%d",&range);
printf(" The fibinocci series is");
printf("\n%d %d ",a,b);
while(c<=range)
{
c=b+a;
a=b;
b=c;
printf("%d" %d ",a,b);
}
}
No comments:
Post a Comment