I am currently a beginner in programming learning, my professor has instructed me to do a program with the instructions below. However when i wrote my program I did the following to take the input from the user on how long the array should be however because my array size isnt defined it gives me an error but the professor hasnt instructed me to specify a size so im really confused :S

**My attempt :**

```
void displayarray(int n){

int i;
int aray[]={0,1};

for (i=0;i<n;i++){
    printf("%i", aray[i]);
}
printf("\n");

```

}

int main()
{ int n;

```
scanf("%i",&n);

displayarray(n);

getchar();
getchar();

```

}

**The Task assigned:**

> 
> The Fibonacci numbers are a famous sequence of numbers. They begin with 0 and 1, and then the next value in the sequence is the sum of the previous two values.
> 
> 
> 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
>  (fib[8] is 21 -- remember to start counting from 0!)
> 
> 
> Write a program that calculates the Fibonacci sequence.
> 
> 
> -Make a function that accepts n, which is the number of integers to generate.
> 
> 
> -Declare an array, initialize it with only the first two Fibonacci numbers, then calculate the rest.
> 
> 
> -Display the sequence for n=10 and n=20.
> 
> 
> -Try generating output for n=50. If anything goes wrong in this step, you don't need to fix it. Just add a comment explaining what happens, and why.
> 
> 
>