Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string substr(string word)
- {
- string word2;
- for (int i = 0; i <= word.size(); i++)
- { //removes vowels
- if (word[i] != 'a' && word[i] != 'A' && word[i] != 'e' && word[i] != 'E' && word[i] != 'I' && word[i] != 'i' && word[i] != 'o' && word[i] != 'O' && word[i] != 'u' && word[i] != 'U')
- {
- word2 += word[i];
- }
- }
- return word2;
- }
- int main()
- {
- string word;
- cout << "please enter a word: ";
- cin >> word;
- //calls to remove vowels
- cout << "your new word is: " << substr(word);
- return -0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement