Advertisement
skb50bd

Small/Capital Letter Counter

Mar 20th, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int sl=0, cl=0;
  5.     char m = getchar();
  6.     while(m!= '\n')
  7.     {
  8.         if(m>='a' && m<='z')
  9.             sl++;
  10.         else if(m>='A' && m<='Z')
  11.             cl++;
  12.         m = getchar();
  13.     }
  14.     printf("Small Letters: %d\nCapital Letters: %d",sl,cl);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement