#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int main()
{

    char password[20];
    int upperC,lowerC,digit,symbol;
    upperC = lowerC = digit = symbol = 0;
    int len,ctr;
        printf("Enter a password (containing an upper case,a number and a $ sign) \n");
        scanf(" %s",password);
        len = strlen(password);
        if(len>=8) {
        for(ctr=0;ctr<=20;ctr++){

                if(isupper(password[ctr])){
                    upperC++;
                }else if(islower(password[ctr])){
                    lowerC++;
                }else if(isdigit(password[ctr])){
                    digit++;
                }else if(password[ctr]=='!' || password[ctr]=='@' || password[ctr]=='#' || password[ctr]=='$' || password[ctr] == '%' || password[ctr]== '^'
                         || password[ctr]=='&' || password[ctr]== '*'){
                    symbol++;
                }
        }
        if(upperC>=1 && lowerC>=1 && digit>=1 && symbol<1){
            printf("Your password is good. Successful!");
        }
        else if(upperC<1 || digit < 1){
            printf("Password should have at least 1 number and 1 Upper case");
        }else {
            printf("Password should not contain any special characters, symbols or spaces");
        }
        }else{
            printf("Your password is too short!(must contain 8-20 characters)");
        }
    return 0;
}