Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int i,capital=0,small=0,digit=0;
- char str[40]="SUit MA QueeN02";
- for(i=0; i<strlen(str); i++)
- {
- if(str[i]>='A' && str[i]<='Z')
- {
- capital++;
- }
- if(str[i]>='a' && str[i]<='z')
- {
- small++;
- }
- if(str[i]>='0' && str[i]<='9')
- {
- digit++;
- }
- }
- printf(" Capitals are in %d",capital);
- printf("\nSmalls are in %d",small);
- printf("\nDigits are in %d",digit);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement