challenge #1

0 Anas Abd Daim · September 26, 2014
here is my code ..

#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>
#include<math.h>
int main ()
    {
        int password =0 ;
        printf("enter password (should contain upper and lower case letters\n besides numbers and characters)\n");
        scanf("%c",&password);
        
        if(isalpha(password))
            {
                if(isupper(password)){
                    
                
                }if(islower(password)){
                    
                }if(isdigit(password)){
                    
                }if(ispunct(password)){
                    
                }
                printf("good pass\n");
            }else {
                printf("easy to guess\n");
            }
            
            
            }


Post a Reply

Replies

Oldest  Newest  Rating
0 Franz Schmidt · September 26, 2014
I don't think this is right if your first char is a alpha(character) it allways says password is ok even the other conditions are not satisfied. 
0 Anas Abd Daim · September 26, 2014
I didn't think of that ...thanks for this note I will try to fix it ..but  any suggestion? :)
  • 1

C

107,268 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator