Advertisement
snaptrap013

LUL

Jul 18th, 2020
1,692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #define SIZE 100
  4. int main()
  5. {
  6.     char wish[SIZE]="#B3stofLuCK!";
  7.     int x, digit=0, lower=0, upper=0, other=0;
  8.    
  9.     for(x=0; x < strlen(wish); x++)
  10.     {
  11.         if(isdigit(wish[x]))
  12.             digit++;
  13.         else if(islower(wish[x]))
  14.             lower++;
  15.         else if(isupper(wish[x]))
  16.             upper++;
  17.         else
  18.             other++;
  19.     }
  20.     printf("No. of digits : %d\n", digit);
  21.     printf("No. of lowercase letters : %d\n", lower);
  22.     printf("No. of uppercase letters : %d\n", upper);
  23.     printf("No. of other characters : %d\n", other);
  24.     system("pause");
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement