Write a ‘C’ program to accept a string from user and delete all the vowels from that string & display the result.

#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,flag=0;
char s[50];
clrscr();
printf("\n enter the string:-");
gets(s);
printf(" the string is =%s",s);
printf("\n");
while(s[i]!=NULL)
{
if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||s[i]=='A' || s[i]=='E' || s[i]=='I'|| s[i]=='O' || s[i]=='U')
{
flag=1;
}
else
{
printf("%c",s[i]);
}
i++;
}
getch();
}

Comments

Post a Comment