Write A code Of Fibonacci series without Recursion.
#include<stdio.h>
#include<conio.h>
int main(void)
{
int n,l=0,m=1,c=0,counter=1;
printf("How many number you want to Generate: ");
scanf("%d",&n);
printf("%d %d",l,m);
while(counter<=n-2)
{
c=l+m;
printf(" %d",c);
l=m;
m=c;
counter++;
}
getch();
}
#include<conio.h>
int main(void)
{
int n,l=0,m=1,c=0,counter=1;
printf("How many number you want to Generate: ");
scanf("%d",&n);
printf("%d %d",l,m);
while(counter<=n-2)
{
c=l+m;
printf(" %d",c);
l=m;
m=c;
counter++;
}
getch();
}