/**************************************************************ide
*Namc:exam1
*
*Purpose:write a array fib_number *
*Author:Bennett
*
*Date written:1/19/2012
*
*Attention:using command :gcc -Wall -o exam1 exam1.c -std=c99 *
* when you compile the program *
**************************************************************/
#include<stdio.h>
#define LENGTH 40
int main()
{
int fib_number[LENGTH];
printf("Enter the first array number: ");
scanf("%d",&fib_number[0]);
printf("Enter the second array number: ");
scanf("%d",&fib_number[1]);
for(int i=2;i<40;i++)
{
fib_number[i]=fib_number[i-2]+fib_number[i-1]; //c99 only
printf("THE %d number is : %d\n",i,fib_number[i]);
}
return 0;
}