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

We have more than 5 Groups which have 500000+ Members and some Pages have more than 100000+ members. If you want to post your article on our website/FB Group/FB Page please contact on hitesh.xc@gmail.com or 8076671483

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

Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer which are used in java programming. All these tools are available in bin folders so we set path upto bin folders.

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.

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

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android 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