Advertisement
Nayeemzaman

Untitled

Dec 19th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. char str[101];
  5. int ct=0,c=0,s=0,i=0;
  6. scanf(" %[^\n]",str);
  7. while(str[i]!='\0')
  8. {
  9. if(str[i]==' ')
  10. {
  11. ct++;
  12. }
  13. else if(str[i]>='A'&&str[i]<='Z')
  14. {
  15. c++;
  16. }
  17. else if(str[i]>='a'&&str[i]<='z')
  18. {
  19. s++;
  20. }
  21. i++;
  22. }
  23. printf("Word = %d\nUppercase = %d\nlowercase = %d\n",ct+1,c,s);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement