document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5. #include <math.h>
  6.  
  7. int main()
  8. {
  9.     char password[20];
  10.     int check;
  11.     int capital = 0;
  12.     int number = 0;
  13.     int sign = 0;
  14.  
  15.     printf("Please enter your password : ");
  16.     scanf("%s", password);
  17.  
  18.     for(check=0; check <= 19; check++)
  19.     {
  20.         if( isupper(password[check]) )
  21.         {
  22.             capital++;
  23.  
  24.         }
  25.         else if( isdigit(password[check]) )
  26.         {
  27.             number++;
  28.         }
  29.         else if( password[check] == \'$\' )
  30.         {
  31.             sign++;
  32.         }
  33.         else
  34.             continue;
  35.     }
  36.  
  37.  
  38.     if(capital>=1){
  39.         printf("Capital test = %d Passed\\n", capital);
  40.     }else{
  41.         printf("Capital test = 0 Failed\\n");
  42.     }
  43.     if(number>=1){
  44.         printf("Number test = %d Passed\\n", number);
  45.     }else{
  46.         printf("Number test = 0 Failed\\n");
  47.     }
  48.     if(sign>=1){
  49.         printf("Sign test = %d Passed\\n", sign);
  50.     }else{
  51.         printf("Sign test = 0 Failed\\n");
  52.     }
  53.     if(strlen(password) >= 5){
  54.         printf("Minimum required length: %d Passed\\n", strlen(password));
  55.     }else{
  56.         printf("Minimum required length: %d Failed\\n", strlen(password));
  57.     }
  58.  
  59.  
  60.     if (capital == 0 || number == 0 || sign == 0 || strlen(password) <=4){
  61.         printf("\\nYour password needs improving.\\n");
  62.     }else{
  63.         printf("\\nYour password is strong and have %d characters!\\n", strlen(password));
  64.     }
  65.  
  66.     return 0;
  67. }
');