Why scanf() function reads two values when we put spaces after formate specifier even we are passing one reference :     #include<stdio.h>
    main()
    {
    int a;
    printf("Enter a value \n");
    scanf("%d ",&a);
    printf("a=%d \n",a);
    }

in scanf() function i put space after formate specifier. when i compile this program scanf() function reading two values from user but the first value is assigned to 'a'.
1)
why scanf() function reading two values when we use spaces after formate specifier even though we are passing one reference in above program.
2)
why scanf() function reading one value when we use space before formate specifier even though we are passing one reference.
3)
how the scanf() function will work. 