Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. void countChars(char * string, unsigned * lowercase, unsigned * uppercase, unsigned * digits, unsigned * otherChars) {
  2. // Code here
  3. *lowercase=0;
  4. *uppercase=0;
  5. *digits=0;
  6. *otherChars=0;
  7. for(int i=0;i<strlen(string);i++)
  8. {
  9. if(islower(string[i]))
  10. {
  11. (*lowercase)++;
  12. }
  13. else
  14. if(isupper(string[i]))
  15. {
  16. (*uppercase)++;
  17. }
  18. else if(isdigit(string[i]))
  19. {
  20. (*digits)++;
  21. }
  22. else(*otherChars)++;
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement