Hi!

This is my contribution to challenge #1. It is also the first thing i made in C so I'm thankful for any tips or ideas on how to improve it. I couldnt find any way to loop from password[0] to password[9], otherwise it would have been much cleaner. But it does it's job ... kinda ;)

Cheers!

CODE:
----------------------------------------------------------------------------------------------------------------------------------------------
#include <stdio.h>

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

/*

Hi! This is my first try with C. This program require a password
not longer than 10 letters containing at least one capital letter,
one number and a symbol.

The user is forced to start over till a password that responds to
every criteria is entered.

This could be done much better if i found a way to loop from
password[0] to password [9] but i didnt manage to come up with a
way for that. Thankful for any tips!

/The Swede
2014-10-02

*/

int main()
{

    //Setting up char and ints

    char password[10];
    int upperCheck = 0, numberCheck = 0, symbolCheck = 0, lengthCheck = 0;

    printf("Enter your 10 letter password here.\n FYI: We require at least one capital letter, one number and a symbol!\n");

    // Check the length of the password that its not longer than 10 letters
    while(lengthCheck != 1){
        printf("\n#ENTER: ");
        scanf(" %s", password);
        if(strlen(password) >= 11){
            printf("\n\n~ ERROR: You just broke rule #1 - maximum 10 letters. Try again...\n\n");
            lengthCheck = 0;
        } else {
            lengthCheck = 1;
        }
    }

    //Checks if any part of password is upper case
    while(upperCheck != 1){
        if(isupper(password[0]) || isupper(password[1]) || isupper(password[2]) || isupper(password[3]) || isupper(password[4]) || isupper(password[5]) || isupper(password[6]) || isupper(password[7]) || isupper(password[8]) || isupper(password[9])){
            upperCheck = 1;
        } else {
            printf("\n\n~ ERROR: Dude, i'm gonna stop you right there...\nNo capital letter in \"%s\" you know. Try again! \n\nENTER: ", password);
            scanf(" %s", password);
        }
    }

    //Checks if password contains a number
    while(numberCheck != 1){
        if(isdigit(password[0]) || isdigit(password[1]) || isdigit(password[2]) || isdigit(password[3]) || isdigit(password[4]) || isdigit(password[5]) || isdigit(password[6]) || isdigit(password[7]) || isdigit(password[8]) || isdigit(password[9])){
            numberCheck = 1;
        } else {
            printf("\n\n~ ERROR: Hold your horses. No numbers in \"%s\" you know. Try again! \n\nENTER: ", password);
            scanf(" %s", password);
        }
    }

    while(symbolCheck != 1){
        // This sets up the control values for symbols, if one ore more is = 1 (not alpha/number) it will proceed, otherwise force new password.
        int check0 = 0, check1 = 0, check2 = 0, check3 = 0, check4 = 0, check5 = 0, check6 = 0, check7 = 0, check8 = 0, check9 = 0;

        //Checking if any part (0-9) of the password is a symbol:

        if((password[0]>='a' && password[0]<='z') || (password[0]>='A' && password[0]<='Z') || (password[0]>='0'&& password[0]<='9')){
            check0 = 0;
        } else {
            check0 = 1;
        }

        if((password[1]>='a' && password[1]<='z') || (password[1]>='A' && password[1]<='Z') || (password[1]>='1'&& password[1]<='9')){
            check1 = 0;
        } else {
            check1 = 1;
        }

        if((password[2]>='a' && password[2]<='z') || (password[2]>='A' && password[2]<='Z') || (password[2]>='1'&& password[2]<='9')){
            check2 = 0;
        } else {
            check2 = 1;
        }

        if((password[3]>='a' && password[3]<='z') || (password[3]>='A' && password[3]<='Z') || (password[3]>='1'&& password[3]<='9')){
            check3 = 0;
        } else {
            check3 = 1;
        }

        if((password[4]>='a' && password[4]<='z') || (password[4]>='A' && password[4]<='Z') || (password[4]>='1'&& password[4]<='9')){
            check4 = 0;
        } else {
            check4 = 1;
        }

        if((password[5]>='a' && password[5]<='z') || (password[5]>='A' && password[5]<='Z') || (password[5]>='1'&& password[5]<='9')){
            check5 = 0;
        } else {
            check5 = 1;
        }

        if((password[6]>='a' && password[6]<='z') || (password[6]>='A' && password[6]<='Z') || (password[6]>='1'&& password[6]<='9')){
            check6 = 0;
        } else {
            check6 = 1;
        }

        if((password[7]>='a' && password[7]<='z') || (password[7]>='A' && password[7]<='Z') || (password[7]>='1'&& password[7]<='9')){
            check7 = 0;
        } else {
            check7 = 1;
        }

        if((password[8]>='a' && password[8]<='z') || (password[8]>='A' && password[8]<='Z') || (password[8]>='1'&& password[8]<='9')){
            check8 = 0;
        } else {
            check8 = 1;
        }

        if((password[9]>='a' && password[9]<='z') || (password[9]>='A' && password[9]<='Z') || (password[9]>='1'&& password[9]<='9')){
            check9 = 0;
        } else {
            check9 = 1;
        }

        //stops if it doesnt find any symbols
        if(check0==0 && check1==0 && check2==0 && check3==0 && check4==0 && check5==0 && check6==0 && check7==0 && check8==0 && check9==0){
             printf("\n\n~ ERROR: Freeze! No symbols in \"%s\" you know. Try again! \n\nENTER: ", password);
            scanf(" %s", password);
        } else {
            symbolCheck = 1;
        }
    }

    printf("\n\n-------------------------------------------------\nThis high tech Swedish ultra secure password system determine that your password is strong enough.\n\nSincerly,\nThe Swede\n\n-------------------------------------------------\n");
return 0;
}