/* write a c program to accept line from the user delete all the occurance
of the word 'the' and display the result*/
#include<stdio.h>
#include<conio.h>
void main()
{
char str[80],str2[80];
char *p,*s,*q;
int i;
clrscr();
printf("\nenter the string :");
gets(str);
s=str;
p=str2;
while(*s)
{
q=s;
if(*s=='t'||*s=='T')
{
s++;
if(*s=='h')
{
s++;
if(*s=='e')
s++;
else
{
for(i=0;i<=2;i++)
*p++=*q++;
}
}
else
{
*p++=*q++;
s--;
}
}
else
*p++=*s;
s++;
}
*p='\0';
printf("\n\nsentences after remooving all vowel :");
puts(str2);
getch();
}
/*
enter the string :fghdf the ncvb the
sentences after remooving all vowel :fghdf ncvb
*/
No comments:
Post a Comment