Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int i, len;
- int digit_exists = 0, small_letter_exists = 0, capital_letter_exists = 0, symbol_exists = 0;
- char password[10000];
- gets(password);
- len = strlen(password);
- if(len >= 8)
- {
- for(i = 0; i < len; i++)
- {
- if(password[i] >= 'A' && password[i] <= 'Z')
- capital_letter_exists++;
- else if(password[i] >= 'a' && password[i] <= 'z')
- small_letter_exists++;
- else if(password[i] >= '0' && password[i] <= '9')
- digit_exists++;
- else
- symbol_exists++;
- //capital and small letter and digits na hole seta special character,oitar jonnoi symbol exixts use korsi
- }
- }
- if(small_letter_exists != 0 && capital_letter_exists != 0 && symbol_exists != 0)
- {
- printf("Valid Password!\n");
- }
- else
- {
- printf("Invalid Password!\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement