I am trying to input two characters from the user t number of times. Here is my code :    
int main()
{
    int t;
    scanf("%d",&t);
    char a,b;
    for(i=0; i<t; i++)
    {
        printf("enter a: ");
        scanf("%c",&a);
        printf("enter b:");
        scanf("%c",&b);
    }
    return 0;
}
Strangely the output the very first time is:
enter a: 
enter b:
That is, the code doesn't wait for the value of a.
 
     
     
     
    