I wrote a program which is supposed to check if an entered password has an uppercase letter , a lowercase letter and a number. It won't return anything if the password is valid and if the password is invalid it should say "Not a valid password!". But this program doesn't work and I don't understand why.

```
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>

int main()
{
  char pass[20];
  int a, i=0;
  printf("Enter your password. It must contain an uppercase and a lowercase letter with a number. Password should be less than 19 characters.\n ");
  scanf(" %s", pass);
  a = strlen(pass);

  /* Checking if an uppercase letter is present*/

  for(i=0; i<a ; i++)
  {
    if(!isupper(pass[i] && i!=(a-1)))
    {
        continue;
    }
    else if (!isupper(pass[i]))
    {
        printf("Not a valid Password!");
    }
    else
    {
        break;
    }
  }

  /* Checking if a lowercase letter is present */

  for(i=0; i<a ; i++)
  {
    if(!islower(pass[i] && i!=(a-1)))
    {
        continue;
    }
    else if (!islower(pass[i]))
    {
        printf("Not a valid Password!");
    }
    else
    {
        break;
    }
  }

  /* Checking if a number is present*/

  for(i=0; i<a ; i++)
  {
    if(!isdigit(pass[i] && i!=(a-1)))
    {
        continue;
    }
    else if (!isdigit(pass[i]))
    {
        printf("Not a valid Password!");
    }
    else
    {
        break;
    }
  }
}  

```