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
Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from t


i need a program that generates this output: The highest card wins! Suit Order is: clubs, diamonds, hearts and spades The computers card is the 5 of Spades. The player’s card is t

Set of Integers) Create class IntegerSet. Each IntegerSet object can hold integers in the range 0-100. The set is represented by an array of bools. Array element a[i] is true if in

for different operation multiple stack

Question 1 Write a program that accepts a 3x3 matrix from the user and finds the transpose of it Question 2 Explain Brief about class and objects. Also describe friend functi


A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should

Mathematical Statements and assignments    Within C we can directly load up the variable from within the program using the mathematical expression equates (=) e.g.   a= 'h'