Question: I've made a shuffling type program that obtains from `cases[];` and arranges them in a random order.

```
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void deal(void);

int cases[22] =      {1,2,3,4,5,6,8,10,15,20,25,35,50,65,85,100,105,135,165,200,250};

int main()
{

   srand(time(NULL));

  int a = 0;

  deal();

  for(a = 0 ; a < 22 ; a++)
  printf("%d \n", cases[a]);

 return 0;
}

void deal(void){
 int loop;
 int temp;
 int x;
 int y;

 for(loop = 0; loop < 50; loop++){

    x = rand() % 22;
    y = rand() % 22;

    temp = cases[x];
    cases[x] = cases[y];
    cases[y] = temp;
 }
}

```

However when I run the code it comes with a randomly placed `0`. Where is it from and why is it there?

Example output:

```
6
15
0 //I don't want that
20
5
50
10
3
165
65
135
105
8
1
200
25
100
85
2
250
4

```

Answer: 
You declared `int cases[22]` but initialized only 21 integers into that array and therefore, the last element will be 0 when not initialized. Try to add another integer at the end of the array
You have the wrong number of elements in the array. C is a bit stupid, because it is designed so that a compiler can only detect if there is too many elements in an array, but never if there is too few.

To ensure the exact amount of elements, you can declare arrays like this:

```
#define ARRAY_ITEMS(arr) (sizeof(arr) / sizeof(*arr))
#define CASES_ITEMS 22

int cases[] = {1,2,3,4,5,6,8,10,15,20,25,35,50,65,85,100,105,135,165,200,250};

_Static_assert(ARRAY_ITEMS(cases) == CASES_ITEMS, "Wrong array size: cases");

```