Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- char str[101];
- int ct=0,c=0,s=0,i=0;
- scanf(" %[^\n]",str);
- while(str[i]!='\0')
- {
- if(str[i]==' ')
- {
- ct++;
- }
- else if(str[i]>='A'&&str[i]<='Z')
- {
- c++;
- }
- else if(str[i]>='a'&&str[i]<='z')
- {
- s++;
- }
- i++;
- }
- printf("Word = %d\nUppercase = %d\nlowercase = %d\n",ct+1,c,s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement