Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- void main (void){
- char str[50];
- int k=0,C=0,c=0,i;
- printf ("The string is : ");scanf("%s",str);
- for(i=0;i<strlen(str);i++){
- if(isdigit(str[i]))
- k++;
- else
- if (isupper(str[i]))
- C++;
- else
- if (islower(str[i]))
- c++;
- }
- if (k!=0)
- printf("\nThere are %d digits", k);
- else
- printf("\nNo digits");
- if(C!=0)
- printf ("\n There are %d uppercases",C);
- else
- printf ("\n No uppercases");
- if (c!=0)
- printf ("\n There are %d lowercases",c);
- else
- printf ("\n No lowercases");
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement