Advertisement
Salman_CUET_18

password

Mar 18th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     int i, len, count1 = 0, count2 = 0, count3 = 0;
  6.     char password[10000];
  7.  
  8.     gets(password);
  9.     len = strlen(password);
  10.  
  11.    if(len >= 8)
  12.     {
  13.         //null character soho total 9 ta character password e thakbe
  14.         for(i = 0; i < len; i++)
  15.         {
  16.             if(password[i] >= 'a' && password[i] <= 'z')
  17.                 count1++;
  18.             else if(password[i] >= 'A' && password[i] <= 'Z')
  19.                 count2++;
  20.             else
  21.                 count3++;
  22.             //capital and small letter na hole seta special character,oitar jonnoi count3 use korsi
  23.  
  24.         }
  25.  
  26.         if(count1 != 0 && count2 != 0 && count3 != 0)
  27.         {
  28.             printf("Valid Password!\n");
  29.  
  30.         }
  31.         else
  32.         {
  33.             printf("Invalid Password!\n");
  34.         }
  35.  
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement