This is a simple program for getting six character from user and storing it in an array and then to display it.But it is not doing so,the print statement in reading section is printed twice.please help me to solve
#include<stdio.h>
int main()
{
int i=0;
char a[6];
for(i=0 ; i<6 ;i++)
{
printf("Enter a character \n");
scanf("%c",&a[i]);
}
for(i=0 ; i<6 ;i++)
{
printf("%c",a[i]);
}
return 0;