Total Pageviews

Sunday, 3 July 2016

Delete a vowel from a String- C Program

Input- Absolutely

Output- bsltly

PROGRAM

//Delete vowels from a String

#include<stdio.h>
#include<string.h>
int main()
{
char s[20];
int i=0,j=0;
scanf("%s",&s);
for(i=0;i<=strlen(s);i++)
{
if((s[i]=='a')||(s[i]=='e')||(s[i]=='i')||(s[i]=='o')||(s[i]=='u'))
s[i]=' ';
else
s[j++]=s[i];
}
printf("%s",s);
return 0;  
}

OUTPUT

No comments:

Post a Comment