write a program to remove occurrences the word from entered
text?
Answer / jitendra
#include"stdio.h"
#define n 100
void del_char(char str1[n],char str2[])
{
char str[n],*p1,*q,i,j;
p1=str1;
q=str;
*q=*p1;
i=0;
while(*p1!='\0')
{
{
if(*p1==str2[i])
{
p1++;
i++;
if(*p1==str2[i])
{
p1++;
i++;
if(*p1==str2[i])
{
p1++;
i++;
}
else
{
q++;
}
}
else
{
q++;
}
}
else
{
p1++;
q++;
}
*q=*p1;
}
i=0;
}
printf("%s\n",str);
}
main()
{
char str1[n],str2[]={"to "};
printf("please enter a text and includ 'to':\n");
gets(str1);
printf("remove 'to',remaining :\n");
del_char(str1,str2);
getch();}
| Is This Answer Correct ? | 5 Yes | 7 No |
Write a program to reverse a string.
0 Answers Global Logic, iNautix, TCS, Wipro,
What are qualifiers?
What is the meaning of c in c language?
Hai friends im a i year student. i want to develop my knowledge in the field of TSR in c. How I'm Improve ?
which will return integer? a) int*s ( ) b) ( int* ) s( ) c) int ( *s ) ( )
What are structure types in C?
What do you mean by command line argument?
what will be the out put. #include<stdio.h> void main() { printf("Output:"); printf(1+"vikashpatel"); }//output: ikashpatel
What is function pointer c?
why do we use # in c-language?
Explain b+ tree?
How to write a multi-statement macro?