Friday, March 20, 2015

Remove Vowels Program in C++

In this article I would like to share with you a sample program that will remove vowels in a given string or sentence of our user I called this program remove vowels written in C++. What does our program will do is to ask the user to enter any string or sentence then our program will remove or delete vowels that can be found in a given string or sentence. Regardless if the string is lower case or upper case format. I hope you will find my work useful in your learning string manipulation in C++.

If you have some questions please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com

People here in the Philippines who wish to contact me can reach me at my mobile number 09173084360




Sample Program Output


Program Listing

#include <iostream>
#include <ctype.h>

using namespace std;


int main() {
    string text_me;
    char reply;
   do {
    cout << "\n\n";
    cout << "\t========================\n";
    cout << "\t REMOVE VOWELS PROGRAM\n ";
    cout << "\t========================\n";
    cout << "\n";
cout << "\tEnter a String :=> ";
getline(cin,text_me);
cout << "\n\n";
    cout <<"\tORIGINAL TEXT :=> " << text_me;

for (int i=0;toupper(text_me[i])!='\0';i++)
     {
if (toupper(text_me[i])==toupper('a')
            || toupper(text_me[i])==toupper('e')
            || toupper(text_me[i])==toupper('i')
            || toupper(text_me[i])==toupper('o')
            || toupper(text_me[i])==toupper('u'))
         {
text_me[i]=' ';
}
      }
cout << "\n\n";
cout <<"\tVOWEL REMOVE TEXT :=> " << text_me;
cout << "\n\n";
cout << "\t Do You Want To Continue Y/N :=> ";
cin >> reply;
} while(toupper(reply)=='Y');
cout << "\n\n";
cout << "\t === THANK YOU FOR USING THIS PROGRAM ===";
cout << "\n\n";
return 0;
}


No comments:

Post a Comment