Solving C Challenge #1

0 Divulger Michealson · August 2, 2015
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>

int main()
{

char x,e,t,u;

printf("Enter you password below ' Eg. : $Dfl':\n");
scanf(" %c%c%c%c", &x, &e, &t, &u);

if( (isupper(x))||(isupper(e))||(isupper(t))||(isupper(u))  ){

if( (isdigit(x))||(isdigit(e))||(isdigit(t))||(isdigit(u)) ){

if( (islower(x))||(islower(e))||(islower(t))||(islower(u)) ){

if( (x == '$')||(e == '$')||(t == '$')||(u == '$') ){

    printf("Your Password Is An Level 5 Encryption 'md5-md7'");
}
}
}

}else {
    printf("Your password is hackable");
}
return 0;


}

Post a Reply

Replies

Oldest  Newest  Rating
0 Superman HC · August 2, 2015
This is a great start if you are a beginner at C... 
however, i would like to showcase some of the problems : 
 - A user can enter exactly 4 characters neither less nor more...
 - Your special character only includes validation for $
 - suppose a password is approved in d first if condition and not with the second... so there is nothing to show as prompt there.. it would simply do nothing...

Though.. it's a nyc attempt but don't take me wrong.. try to make it more dynamic using some of the more concepts on a professional basis..:)
0 Divulger Michealson · August 2, 2015
ha ha thats ok 
0 Divulger Michealson · August 2, 2015
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>

int main()
{

int x;
int e;
int t;
int u;

printf("Enter you password below:\n");
scanf(" %d", &x, &e, &t, &u);

if((isupper(e))||(islower(x))||(u == '$')||(isdigit(t))){
    printf("You Entered a level 5 Encryption loll md5");
}else{
    printf("Your password is hackable");
}

return 0;


}


i summerized it this was the first program i wrote
  • 1

C

107,048 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator