C program for removing char which u want, C/C++ Programming

C Program for REMOVING CHAR WHICH U WANT

void main()

{

          int i,j;

          char a[100],r;

          clrscr();

          for(i=0;i<100;i++)

                   a[i]=0;

          i=0;

          printf("\N ENTER THE STRING: ");

          do{

                   a[i++]=getchar();

          }while(a[i-1]!='\n');

          a[i]='\0';

          printf("\N ENTER THE CHAR U WANT TO REMOVE? ");

          scanf("%c",&r);

          for(i=0;a[i]!='\0';i++)

          {

                   if (a[i]==r)

                   {

                             a[i]=a[i+1];

                             i++;

                   }

          } a[i]='\0';

          puts(a);        getch();

}

 

Posted Date: 9/10/2012 7:35:28 AM | Location : United States







Related Discussions:- C program for removing char which u want, Assignment Help, Ask Question on C program for removing char which u want, Get Answer, Expert's Help, C program for removing char which u want Discussions

Write discussion on C program for removing char which u want
Your posts are moderated
Related Questions
Find out initial basic feasible solution for the given transportation problem using Least Cost Method (LCM).

Write a C++ program that reads from keyboard 3 integers, with proper input prompt, and then displays the maximum sum of any pair of numbers from these three. If the 3 numbers are 5

A: The procedure of encoding the parameter types along with the function/method name into a unique name is called as name mangling. The inverse procedure is called demangling. F

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Inline function: It is a function without prototype. The function is defined above main. The function should  be  declared  above  main  function.                  Declaring

Objective Using C++ string, classes, constructors and member functions. Task A Write a program (book.cpp) to store a list of book titles and the published dates. Your pro

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th

Write a C program to compute the factorial of  5 i.e. 1x2x3x4x5 etc Write a C program to calculate the output Y for a given value of X for the following formula.       Y=X 2

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.