Challenge 1# Completed

+2 Nishant Tadvi · December 26, 2014

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

int main()
{
    char password[20];
    int check;
    int number = 0, upper = 0, lower = 0, symbol = 0;

    printf("This is a password checker\n\n");
    printf("Enter the Password : ");
    scanf("%s", password);

    for(check = 0 ; (check <= strlen(password)) || (check <= 19); check++){

    if(isdigit(password[check])){
            number = 1;
    }
    if(isalpha(password[check])){
    if(isupper(password[check])){
            upper=1;
    }
    }
    if(isalpha(password[check])){
    if(islower(password[check])){
            lower=1;
    }
    }
    else(password[check]);{
            symbol=1;
    }
}
    if(number==1){
            printf("The Test Number : Passed\n");
    }
    else{
            printf("The Test Number : Failed\n");
    }
    if(upper==1){
            printf("The Test Upper : Passed\n");
    }
    else{
            printf("The Test Upper : Failed\n");

    }
    if(lower==1){
            printf("The Test Lower : Passed\n");
    }
    else{
            printf("The Test Lower : Failed\n");
    }
    if(symbol ==1){
            printf("The Test symbol : Passed\n");
    }
    else{
            printf("The Test symbol : Failed\n");
    }
    if(number == 0 || upper == 0 || lower == 0 || symbol == 0){
            printf("Your Password need to Improved\n\n");
    }
    else{
            printf("Your Password is Strong.");
    }
    return 0;
}

Please Give me some suggection & i dont use "$" as to make something different thx for seeing it. waiting for suggection.


i have some mistakes in coding so help me. 

Post a Reply

Replies

Oldest  Newest  Rating
+1 Nishant Tadvi · December 27, 2014
Thx for suggection.
+1 Alex Berezovsky · December 27, 2014
what is strlen()?
0 c student · December 27, 2014
strlen() determines the length of a specified string in bytes
0 Logan Mayora · January 7, 2015
Where did you get the idea to use check as a boolean?
  • 1

C

107,220 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator