Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.   int c;
  6.   long num_upper, num_lower;
  7.   num_upper = num_lower = 0;
  8.  
  9.   while((c = getchar()) != EOF)
  10.   {
  11.     if (c != ' ' & c != '\n' & c != '\t')
  12.     {
  13.       if ((c & 0x20) == 0)
  14.         ++num_upper;
  15.       else
  16.         ++num_lower;
  17.     }
  18.   }
  19.   printf("Number of upper-case letters: %ld\n", num_upper);
  20.   printf("Number of lower-case letters: %ld\n", num_lower);
  21.  
  22.   return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement