In let us C it is mentioned that "while assigning an array we have to commit to the size of the array at the time of writing the programs". But in the code below I'm giving the size at the time of execution still it's working so which is correct ?
code :
#include <stdio.h>
void main(){
{
int n,i;
printf("give the size of the array \n");
scanf("%d",&n);
int a[n];
printf ("give array elements\n");
for (i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
}