Delete Vowels from String in C

Google Advertisements

Prev Tutorial Next Tutorial

C Program to Delete Vowels from String

To delete vowels from the string in C program, Here we get any string from user and remove all vowels from given string, vowels are (a, A, e, E, i, I, o, O, u, U). Next we start checking for vowel. If any one found of the 10 then place the next character after the found to the back until the last and so on. For example we enter string Harry as a input, after run this code result will be Hrry. You can also see this code in C Programming Language, C++ Program to Delete Vowels from Given String

Delete Vowels from String in C

#include<stdio.h>
#include<conio.h>
#include<string.h>

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

Output

Please Enter any String: Harry
After Deleting the vowels, the String is: Hrry  

Output

Please Enter any String: Gaurav
After Deleting the vowels, the String is: Grv  

Output

delete vowel from string
Prev Tutorial Next Tutorial

Google Advertisements

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: hitesh.xc@gmail.com or 8076671483 Try this Keyword C++ Programs