#include <stdio.h>
#define MAX 100
char isVowel(char ch);
void eliminateVowels(char *buf);
int main()
{
char str[MAX]= {0};
printf("Enter string: ");
scanf("%[^
]s",str);
printf("Original string: %s
",str);
eliminateVowels(str);
printf("After eliminating vowels string: %s
",str);
return 0;
}
char isVowel(char ch)
{
if( ch=='A' || ch=='a' ||
ch=='E' || ch=='e' ||
ch=='I' || ch=='i' ||
ch=='O' || ch=='o' ||
ch=='U' || ch=='u')
return 0;
else
return 1;
}
void eliminateVowels(char *buf)
{
int i=0,j=0;
while(buf[i]!='')
{
if(isVowel(buf[i])==0)
{
for(j=i; buf[j]!=''; j++)
buf[j]=buf[j+1];
}
else
i++;
}
}