Computer Science, asked by mrunknown4812, 6 hours ago

WAP to take 10 names,count and print how many names starts with vowels and how many starts with consonants.​

Answers

Answered by asthajaipuriaschool
1

Answer:

I am unable to understand

Answered by anjumanyasmin
0

#include <stdio.h>  

int main()  

{  

   //Counter variable to store the count of vowels and consonant  

  int i, vCount = 0, cCount = 0;  

  char str[] = "This is a really simple sentence";  

  for(i = 0; i < strlen(str); i++){  

      str[i] = tolower(str[i]);  

      if(str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u') {  

          //Increments the vowel counter  

           vCount++;  

       }  

       else if(str[i] >= 'a' && str[i] <= 'z'){  

           //Increments the consonant counter  

           cCount++;  

       }  

  }  

  printf("Number of vowels : %d\n", vCount);  

  printf("Number of consonant : %d", cCount);  

  return 0;  

}  

Similar questions