SHARE
TWEET

tasskii 2

Mary_99 Feb 1st, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.  
  9.     int upper = 0, lower = 0;
  10.     char ch[256];
  11.     int i;
  12.     int j;
  13.     int n;
  14.    
  15.     printf("Enter the integer number od stings n = ");
  16.     scanf(" %d", &n);
  17.     do{
  18.         for(j = 0; j<n; j++)
  19.         {
  20.            
  21.            
  22.                 scanf("%s", ch);
  23.                 printf("%s ", ch);
  24.                
  25.            
  26.         }
  27.     }while(isdigit(n));   //check if input n is the integer
  28.    
  29.     for(j = 0; j<n; j++)
  30.     {
  31.             i = 0;
  32.         while (ch[i] != '\0')
  33.         {
  34.         if (ch[i] >= 'A' && ch[i] <= 'Z')
  35.        
  36.         upper++;
  37.        
  38.          if (ch[i] >= 'a' && ch[i] <= 'z')
  39.          
  40.         lower++;
  41.        
  42.         i++;
  43.         }
  44.     }
  45.    
  46.     printf("\nNumber of capital letters : %d    Number of small letters: %d", upper, lower);
  47.    
  48.  
  49.  
  50.    
  51.    
  52.    
  53.    
  54.    
  55.    
  56.    
  57.    
  58.    
  59.    
  60.    
  61.    
  62.    
  63.     return 0;
  64. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top