Advertisement
apl-mhd

vowel check and string length count

Sep 4th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /*vowel check and string length count*/
  5.  
  6.  
  7. int main()
  8. {
  9.  char name[100];
  10.  int i, vowel = 0;
  11.  
  12.  gets(name);
  13.  
  14.  printf("%s\n", name);
  15.  
  16.  for( i = 0; name[i]; i++){
  17.  
  18.    if(name[i] == 'a' || name[i] == 'e' || name[i] == 'i' || name[i] == 'o' || name[i] == 'u'){
  19.        vowel++;
  20.        }
  21.  
  22.  }
  23.  
  24.  printf("Length = %d vowel=%d\n", i,vowel);
  25.  
  26.  
  27.  
  28.  
  29.  
  30.    return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement