I am unable to put the value in the first element of the array. It's always asking to put the value in array second element.
#include<stdio.h>
#include<string.h>
int main(void)
{
    int a, i;
    char names[50][50];
    
    printf("\nEnter the number of names you want :");
    scanf("%d", &a);
    for(i = 0; i < a; i++)
    {
        printf("\n%d name :", i);
        gets(names[i]);
    }
    
    printf("\nThe required name lists :");
    for(int i = 0; i < a; i++)
    {
        printf("\n%d name :", i+1);
        puts(names[i]);
    }
    return 0;
}
 
     
     
    