Viewing code of FIB_NO_R
// ------ ../cgi-bin/cout/FIB_NO_R.CPP --------------
//--- Programmed By Rajesh -----

/*
This is a program to calculate fibonacci numbers without no recursion
Program by rajesh Pandey
to cope for the examination paper first internal exams of CE 2004

*/
#include<stdio.h>
#include<conio.h>
long int fib(int n)
{
int i=1,temp = 1,f1=1,f2=1;

for(i=2;i<n;i++)
{
temp=f1+f2;
f1=f2;
f2=temp;

}

return temp;


}
void main()
{
int input,i;
clrscr();

printf("Enter number of fibonacci numbers to generate:");
scanf("%d",&input);
for(i=1;i<=input;i++)
{
printf("\n%d",fib(i));
}
getch();
}