#include <stdio.h>

// This program prints out however many digits
// of the Fibonacci sequence the user specfies.
// The Fibonacci sequence is found by adding the last
// digit to the digit before it. It begins:
// 1 1 2 3 5 8 13 21 34 55 89 144...

int main(void){
	int prevdigit = 0;
	int currdigit = 1;

	int ndigitsToPrint;

	printf("How many digits do you want to print? \n");
	scanf("%d",&ndigitsToPrint);

	int digitNo;

	for (digitNo = 1; digitNo < ndigitsToPrint; digitNo++){
		
		printf("Fibonacci number %d is %d\n",digitNo,currdigit);

		int temp = currdigit;
	
		currdigit = currdigit + prevdigit;

		prevdigit = temp;
	}
		
	

	return 0;
}
