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 JAPJEET SINGH · August 11, 2015
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

int main()
{

    char pass[20];
    int i,flag;
    printf("Enter the password:");
    scanf(" %s",pass);
    for(i=0;i<=20;i++){
        if(isdigit(pass)||pass=='$')
           flag=1;
           else{
            flag=0;
            break;
           }
    }

            if(flag==1){
            printf("good password");
            }
            else{
            printf("bad password");
            }
    return 0;
}
0 Toyen . · August 12, 2015
Hey there Jap!

Congrats on completing the challenge, but I dont get the "i flag" thing you have there, what exactly is the intention?
  • 1
  • 2

C

128,033 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator