// header files that include standard functions
#include <stdio.h>   // for IO
#include <string.h>  // for manipulating strings
#include <math.h>    // alternate math functions

//the main program
int main()
{
//define variables used in the program
long int i1, i2, i3, irep ;
float rat ;

//initialize i1 and i2
i1 = 0 ; i2 = 1 ;

//print i1 and i2 to screen
printf("%i \n",i1) ;
printf("%i \n",i2) ;

//loop over the fibonacci algorithm
//irep is a dummy counting index
 for(irep = 1; irep < 100000 ; irep++)
 {
// the fibonacci algorithm
 i3 = i2 + i1 ;

 rat = float(i3)/float(i2) ;
// print the current fibonacci number and the ratio to the screen
 printf("%i ratio = %15.11E\n",i3,rat) ;
 i1 = i2 ;
 i2 = i3 ;
 getchar() ; //getchar pauses until you hit return
 }
}
