donmike25

tutorial 8(4)

Aug 23rd, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(){
  5.  
  6. char str[50], vowel[50]="",consonant[50]="";
  7. int len,i,c=0,v=0;
  8.  
  9. printf("Please enter a word: ");
  10. gets(s);
  11. len=strlen(s)
  12.  
  13. for (i=0;i<len;i++){
  14. is(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){
  15. vowel[v]=s[i];
  16. v++
  17. }
  18. else{
  19. consonant[c]=s[i];
  20. c++
  21. }
  22. }
  23. printf("\nNumber of letters: %d",len);
  24. printf("\nNumber of vowel: %d->",v);
  25.  
  26. puts(vowel);
  27. printf("Number of consonant:%d->",c);
  28. puts(consonant);
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment