If you want
a[m];
From C99 you have VLA
int m;
scanf("%d",&m);
int a[m];
Because I see in your code you are trying to scan the size of the array.
Alternatively you can have a dynamic array
int *a = malloc(sizeof(int) * m);
@Sourav has already mentioned the reason for crash.
The value of m
is undeterminate.