finding the fibonacci series between the ranges each and every series 5-8 like this in c language
#include<conio.h>
#include<stdio.h>
int main()
{
int r1=5,r2=7,a,b,c;
for(int i= r1; i<=r2; i++){
printf("The fibonacci series of %d :: ",i);
a=0,b=1;
printf("%d %d",a,b);
for(int j=2; j<i; j++){
c=a+b;
printf(" %d",c);
a=b;
b=c;
}
printf("\n");
}
return 0;
}
Comments
Post a Comment