C Program Remove Vowels From Sentence

This C Program Removes the Vowels from a sentence. This is a part of Mumbai University MCA Colleges C Program MCA Sem 1.
The Vowels are a,e,i,o,u


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,len;
char sent[100];
clrscr();
printf("Enter a sentence\n");
gets(sent);
for(len=0;sent[len]!='\0';len++);
for(i=0;i<len;i++)
{
if(sent[i]=='a'||sent[i]=='e'||sent[i]=='i'||sent[i]=='o'||sent[i]=='u'||
sent[i]=='A'||sent[i]=='E'||sent[i]=='I'||sent[i]=='O'||sent[i]=='U')
{
for(j=i;j<len;j++)
{
sent[j]=sent[j+1];
}
i--;
}
}
printf("\n\nThe sentence with no vowels in it is as\n");
puts(sent);
getch();
}


Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

No comments:

Post a Comment

Post a Comment