Ok so my code runs and will print "password accepted" if the password contains a capital letter, number and the symbol $. It will print "password rejected" is the password doesn't

contain any of these things and will prompt the user to re enter a new password. The trouble i am having is when the password contains just one or two of the things. It still prints out "password rejected" but jumps out of the loop and doesn't prompt the user to re enter a password.


#include
#include
#include

int main()
{
    char password[20];
    int a=0;
    int b=0;
    int c=0;
    int temp = 0;


while(a==0 && b==0 && c==0)
    {


    printf("Please enter new password. (Must contain a capital, number, and $\n");
    scanf(" %s", &password);



 for(temp=0; temp