#include<iostream.h>
using namespace std;
int main()
{
int vow_cnt=0;
char name[15];
cout<<"Enter a name"<<endl;
cin>>name;
cin>>name;
for(int i=0;i<strlen(name);i++)
{
if(name[i] == 'a' || name[i] == 'e'||name[i] == 'i'||name[i] == 'o'||name[i] == 'u')
{
vow_cnt++;
}
}
cout<<"Total Vowels in the string are=>"<<vow_cnt<<endl;
}
I/P : jithendra
O/P : 3
No comments:
Post a Comment