How to delete the vowels from a given string using C language?

CServer Side ProgrammingProgramming

The logic we use to implement to delete the vowels from the given string is as follows −

for(i=0; i<len; i++) //repeat until i<len{
   if(str[i]=='a' || str[i]=='e' || str[i]=='i' || //checking to delete the vowels
   str[i]=='o' || str[i]=='u' || str[i]=='A' ||
   str[i]=='E' || str[i]=='I' || str[i]=='O' ||
      for(j=i; j<len; j++){


Following is the C program for deleting the vowels in a given string −

void main(){
   char str[20];
   int len, i, j;
   printf("Please Enter any String: ");
   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++){
   printf("After Deleting the vowels, the String is: %s",str);


When the above program is executed, it produces the following result −

Please Enter any String: TutorialsPoint
After Deleting the vowels, the String is: TtralsPint
Published on 08-Mar-2021 10:31:28