Challenge 1:-

+1 Manisha Kohli · October 8, 2015
int main()
{
      char password[9];
      int i,upper,lower,digit,special;
int l;
upper=lower=digit=special=0;
i=0;
// Enter the password

printf("Enter your password(max 8 characters)");
scanf(" %s", password);
l=strlen(password);
for(i=0;i<=l-1;i++)
{
    char c= password;
if(c>='A'&& c<='Z')
{
upper++;
}

else if(c>='a' && c<='z')
{
lower++;
}
else if(c>='0' && c<='9')
{
digit++;
    }
else if(c=='$')
{
special++;

}
     }
if((upper!=0)&&(lower!=0)&&(digit!=0)&&(special!=0))
       printf("Nice work");
     else
        printf("try again");

return 0;

}

Post a Reply

Replies

Oldest  Newest  Rating
0 siddharth pal · October 26, 2015
in for loop-
char c= password;

edit this and your code wil work :)
  • 1

C

106,992 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator