Vowels and Consonants

Description:

Find the total number of vowels and consonants in a given string Test Case 1 Input (stdin) abcde Expected Output VOWELS:2 CONSONANTS:3 Test Case 2 Input (stdin) srmuniv Expected Output VOWELS:2 CONSONANTS:5

Program :

#include <iostream>

#include<string.h>

using namespace std;

int main()

{

char a[50];

  int i,v=0,c=0;

  cin>>a;

  for(i=0;i<strlen(a);i++)

  {

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

    v++;

    else

      c++;

  }

  cout<<"VOWELS:"<<v<<"\nCONSONANTS:"<<c;

return 0;

}