answersLogoWhite

0

#include

#include

#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 "};

clrscr();

printf("please enter a text and includ 'to':\n");

gets(str1);

printf("remove 'to',remaining :\n");

del_char(str1,str2);

getch();

return 0;

}

Output:

please enter a text and includ 'the':

Write a c program to simulate the calculator using function

remove 'the',remaining :

Write a c program to simulate calculator using function

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


How do you write a program that removes all occurrences of a given X in a given sequence of numbers?

You do nothing! A sequence of numbers will contain no X and so nothing needs doing!


Write a program to enter a character and it will tell the character etered?

{char a;...cout > a;cout


Can program development be done by a program?

Yes and no, program development works in programming codes which are specifically made for humans to be entered, a program can write these programming codes too. The thing is, you would need to write the programming codes yourself before the program can use it in program development. If a program could invent the wheel, then you still need to invent that wheel before the program can. Or atleast until the thinking of the human brain can be translated into mere programming code.


Write a C program to find occurrences of given character in a sentences?

unsigned find (const char* str, char c) { unsigned total; total = 0; if (str!=NULL) while (*str) { if (*str++==c) ++total; } return total; }


How do you Write a program that determines the number of occurrences of each digit in a given integer n?

there could be a part in it like this: int num, digit; int count [10]; do { digit = num%10; num != 10; ++count[digit]; } while (num);


Write a program in pascal that calculates the area of a circle?

{Area s the area of cube} {Length is the length of one side of the cube} program AreaofCube; var Area,Length:real; begin write('Enter the length of cube: '); readln(Length); Area:=6*(Length*Length); writeln('The area of cube is ', Area, ' cm^2.'); end.


How to write program for secant method in mathematica?

How to write a program for secant method by mathematica


How do you write Square program using vb?

write a vb program to find the magic square


Write a program to multiply 33 matrix.?

write a program to multily 3*3 matrix.


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


How do you write a program that stops when a negative value is entered?

It depends what programming language you want to use. A simple BASIC program would be... 10 INPUT x 20 IF x>0 THEN GOTO 40 30 END 40 PRINT x 50 GOTO 10