remove adjacent characters to vowels

0 votes
asked Mar 6, 2019 by PPriyanka1399 (140 points)

1 Answer

0 votes
answered Mar 8, 2019 by Nikhita
int main()
{
    int n,x=0;
    
    string s;
    getline(cin,s);
    cout<<s;
    char s1[5]={'a','e','i','o','u'};
    for(int i=0;i<s.length();i++)
    {
       // cout<<"foor \n";
        for(int j=0;j<5;j++)
        {
            //cout<<"loop \n";
            if(s[i]==s1[j])
            {
                x=1;
              //  cout<<"occured \n";
                break;
                
            }
        }
        if(x!=0)
        {
            for(int k=i+1;k<s.length();k++)
            {
                s[k]=s[k+1];
            }
        }
        x=0;
    }
    cout<<s;
    return 0;
}
commented Mar 8, 2019 by Nikhita
it will print your entered string first and with tht will print string having characters removed adjacent to vowel
by Nikhita
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...