C++ Programming Code Examples C++ > Strings Code Examples Programming Code to Delete Vowels from String Programming Code to Delete Vowels from String To delete all the vowels from the string in C++ programming, you have to ask to the user to enter the string, now start checking for vowel (i.e., a, A, e, E, i, I, o, O, u, U) to delete all the vowels from the string. If any one found of the 10 (5 lowercase and 5 uppercase) then place the next character after the found to the back until the last and continue to next found, as shown here in the following program. Following C++ program ask to the user to enter a string to find and delete all the vowel present in the string, then display the new string after deleting all the vowels, on the screen: /* C++ Program - Delete Vowels from String */ #include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> void main() { clrscr(); char str[20]; int len, i, j; cout<<"Enter a string : "; gets(str); len=strlen(str); for(i=0; i<len; 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') { for(j=i; j<len; j++) { str[j]=str[j+1]; } len--; } } cout<<"After deleting the vowels, the string will be : "<<str; getch(); }