Hi,
I just started learning C. In fact im not even through the entire tutorial yet. I've got very little experience with programming but i get the basic idea of it.

I wrote a small program just to get used to the syntax and practice a bit. It's suposed to be a kind of an electronic bank account simulation program.

Anyway, this loop im confused over is supose to take the users password, check whether its correct or not. If its not correct its suposed to give you 2 more tries before giving you the message that you've extended your limit of tries.
However, it only gives you one more try before that happends.

Here is the code:

Code:
int main()
{
    int A;
    printf("Welcome to SeaBank electronic bank service. Seabank, Syncing people with finance.\n At any time you would like to go back through the menu, please press 6\n");
    printf("Please enter your four digit password.\n");
    scanf("%d",&A);


    if (A != password)
    {
        int x;
        for (x = 0;(A != password);x++)
        {
            printf("Your password is incorrect. Please try again.\n");
            getchar();
            scanf("%d",&A);
            if (x = 3)
            {
                printf("You have typed in the wrong password too many times. Please consult your bank for further inquiry");
                break;
            }
        }
    }
    else {account();}
    return;
}