Advertisement
apl-mhd

pointerVowelConsonent

Dec 17th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char **argv)
  4. {
  5.    
  6.    
  7.     char str[100];
  8.    
  9.    
  10.     char *ch;
  11.     int n, vowel,consonent;
  12.    
  13.     vowel = 0;
  14.     consonent = 0;
  15.    
  16.     ch = str;
  17.    
  18.     gets(str);
  19.    
  20.    
  21.     for(n=0; ch[n]; n++){
  22.        
  23.        
  24.             if( ch[n] == 'a' || ch[n] ==  'e' || ch[n] ==  'i' || ch[n] ==  'o' || ch[n] ==  'u')
  25.    
  26.                 vowel++;
  27.                
  28.             else{
  29.                
  30.                 consonent++;
  31.                
  32.                 }
  33.         }
  34.        
  35.        
  36.         printf("vowel = %d\nconsonent = %d\n", vowel, consonent);
  37.        
  38.        
  39.    
  40.    
  41.    
  42.    
  43.    
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement