Advertisement
Guest User

I'm crazy doing it at mindnigt

a guest
Feb 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<string.h>
  4. int main()
  5. {
  6.     char str[25],a;
  7.     int count=0,i;
  8.    
  9.     printf("Enter a word:");
  10.     scanf("%d",&str);
  11.    
  12.     a=strlen(str);
  13.    
  14.     for(i=0; i<a; i++){
  15.         if(strcmp(str,'a')==0)
  16.             count++;
  17.         else if(strcmp(str,'e')==0)
  18.             count++;
  19.         else if(strcmp(str,'i')==0)
  20.             count++;
  21.         else if(strcmp(str,'o')==0)
  22.             count++
  23.         else if(strcmp(str,'u')==0)
  24.             count++;
  25.         else
  26.             count = count + 0;
  27.     }
  28.     printf("The number of vowels is %d",count);
  29.     printf("The number of consonznts is %d",strlen-count);
  30.     getch();
  31.     return 0;
  32.    
  33.    
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement