Hi there i tried bucky's challenge with some improvements, actually i was bored so i did it.

Tell me what do you think about it and what should i improve and work on ;)

Sorry I haven't posted it in code block but it's bugged.





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

int main()
{

    char pass[15];
    int letters = 0;
    int uppercases = 0;
    int numbers = 0;
    int dollarsigns = 0;
    int x = 0;

    printf("Enter a password of max 15 characters: \n");

    do{
    if(strlen(pass) > 15)
    {
        printf("Your password is too long \n");
    }
    scanf("%s", pass);
    }
    while(strlen(pass) > 15);

    for(x = 0; x<strlen(pass); x++)
    {
        if( isdigit(pass[x]) )
        {
            numbers++;
            continue;
        }
        if( isalpha(pass[x]) )
        {
            letters++;

            if( isupper(pass[x]) )
            {
                uppercases++;
                continue;
            }
        }else{
            dollarsigns++;
        }
    }

    printf("Your password has: \n %d letters \n %d uppercase letters \n %d numbers \n %d dollarsigns \n", letters, uppercases, numbers, dollarsigns);
    if(numbers == 0)
    {
        printf("Your password lacks numbers \n");
    }
    if(uppercases == 0)
    {
        printf("Your password lacks uppercases \n");
    }
    if(dollarsigns == 0)
    {
        printf("Your password lacks dollarsigns ");
    }

}