Thursday, February 9, 2012

DELETE THE VOWELS FROM A STRING


#include<stdio.h>
#include<conio.h>
void main()
{
char str[20],s[20];
int i,j=0;
clrscr();
printf("Enter any string->");
scanf("%s",str);
printf("The string is->%s",str);
for(i=0;i<=strlen(str);i++)
{
if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
str[i]=' ';
else
s[j++]=str[i];
}
s[j]='\0';
printf("\nThe string without vowel is->%s",s);
getch();
}

No comments:

Post a Comment