Write a c program to accept the line from user and delete the all occurrences of word ‘the’ from the line and display the result

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
char s1[20],*p;
clrscr();
printf("\n enter the string\n");
gets(s1);
p=strtok(s1," ");
while(p!=NULL)
{
if(strcmp(p,"the")!=0)
printf("\t%s",p);
p=strtok(NULL," ");
}
getch();
}

Comments