Facebook
From Shafiqul Islam, 1 Year ago, written in C.
Embed
Download Paste or View Raw
Hits: 147
  1. #include <stdio.h>
  2. int main(){
  3. // Problem 03
  4. char str1[100000];
  5.  
  6. fgets(str1, sizeof(str1),stdin);
  7. int v=0,c=0,o=0,n=0,i=0;
  8. while(str1[i] != '\0'){
  9.     if(str1[i] == 'a' || str1[i] =='e' || str1[i] =='i' || str1[i] =='o' || str1[i] =='u'
  10.     || str1[i] == 'A' || str1[i] =='E' || str1[i] =='I' || str1[i] =='O' || str1[i] =='U'){
  11.         v++;
  12.     }else if(str1[i] >= 'a' && str1[i] <= 'z' || str1[i] >= 'A' && str1[i] <= 'Z' ){
  13.         c++;
  14.     }else if(str1[i] >= '0' && str1[i] <= '9' ){
  15.         n++;
  16.     }else{
  17.         o++;
  18.     }
  19.     printf("%c ",str1[i]);
  20.  
  21.     i++;
  22.  
  23. }
  24.  
  25. printf("Vowel- %d \n",v);
  26. printf("Consonet- %d \n",c);
  27. printf("Number- %d \n",n);
  28. printf("Other- %d \n",o);
  29.  
  30.  
  31.     return 0;
  32. }