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
a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.



Simpson's Rule is a more accurate method of numerical integration than the method described in class. Using Simpson's Rule, the integral of a function f between a and b is approxim

Explain the parts of operators Assignment Operators The equal (=) sign is used for assigning a value to another. The left hand side has to be a variable (lvalue, which exc

TO CONVERT A NUMBER OR A DIGIT INTO ALPHABET

Project Description: We are seeking someone to search mp3 link form audio or m3u8 for videos. Skills required are .NET, C Programming, Engineering, C# Programming

how objects are initialized dynamically?

how to declare arrays

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''''''{'''''''' and end wi