Challenge #1 problem

+1 Ahmed Samir · August 6, 2015
Hey guys i tried to solve challange no.1 today and that's the code i made 



#include
#include
#include
#include

int main(){

char a = 'a';
char password[10]  ;
int lower, upper, sympol, num ,i;
lower = upper = sympol = num = 0;

scanf_s("%s", password);

for (i = 0; i = 1 && lower >= 1 && sympol >= 1 && num >= 1){
printf("well done");
}
else{
printf("you suck");

}

scanf_s("%c", &a);

return 0;
}


but then everytime i try to to run the code and enter any value i get this 

/images/forum/upload/2015-08-05/6b1cabf17c31d68d7ebb8fd0436967a5.jpg

i checked the code many times ... but i can't even understand what is the error about

Thanks in advance 

Post a Reply

Replies

- page 2
Oldest  Newest  Rating
0 Ahmed Samir · August 7, 2015
eh.. it doesn't seem to appear right in the post
here is the one i used 
---------------------
--------------------------
int main(){


char password[10] ;
int lower, upper, sympol, num ,i;
lower = upper = sympol = num = 0;

scanf_s("%s", password);

for (i = 0; i <= 30; i++){
if (isalpha(password)){
if (isupper(password)){
upper++;
}

}
else { lower++;
}

if (isdigit(password)){
num++;

}
else {
sympol++;
}

}

if (upper >= 1 && lower >= 1 && sympol >= 1 && num >= 1){
printf("well done");
}
else{
printf("you suck");

}


return 0;
}

-----------------------------------
0 c student · August 7, 2015
check your for loop
  • 1
  • 2

C

107,188 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator