Saturday, 17 January 2015

Vowels Count of any Message using if statement in c++



#include
#include
using namespace std;
int main()
{
    string str;
    int vowel=0;
    cout<<"Enter message:\t";
    getline(cin,str);
    for(int i=0;str[i]!='\0';i++)
    {
       if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u'||str[i]=='A'||str[i]=='E'||str[i]=='I'||str[i]=='O'||str[i]=='U')
        vowel++;      
    }
    cout<<"\n\t\tVowels==\t"<

0 comments:

Post a Comment