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
Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v

program for compiler design in c

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

For this program, you are going to modify your previous program (program 3) so that it will now have a menu to see if the user wants to read the input from a file or interactively.

Pebble Merchant Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides

Define register with bit fields? We could define register simply with bit fields: struct DISK_REGISTER { unsigned ready:1; unsigned error_occured:1; unsigned disk_spinni

Based on the automobile's model year and weight, the city of Cebu determines the car's weight class and registration fee using the following schedule: Model Year Registration

Assume we wish to partition the square roots of the integers from 1 to 100 in to two piles of fifty numbers every, such that the sum of the numbers in the first pile is as close as

program of area under integration

Program is to find the maximum from two numbers: Program is to find the maximum from two numbers entered by the user having pointer variable as parameter void main()   {