I'm testing the scanf function to check whether or not it has read in one value (an integer) according to the user input. In my netbeans IDE, the program compiles but upon entering a value of x like '6' nothing happens, until it is entered again, then the program proceeds to react correctly, printing the first if statement. Any help on this issue would be much appreciated:

Again here is a snippet: 

```
int main(void)
{
    int x;
    printf("please enter a value for x");
    scanf("%d",&x);

    if(scanf("%d",&x) == 1) // checks to see if it contains one value
        printf("x value has one value");

    else
        printf("X value is not an integer or has more than one value");

}

```