Saturday, 25 May 2013

0 A C - PROGRAM TO REPLACE MORE BLANKS OF ANY STRING WITH SINGLE BLANK

THIS IS A PROGRAM WHICH WILL REPLACE MORE BLANK (IF PRESENT) WITH A SINGLE BLANK....
THE PROGRAM IS :
#include<stdio.h>
#include<conio.h>
int main(void)
{
    char c;
    int inspace;
    inspace=0;
    while((c=getchar(c))!=EOF)
    {
        if(c==' ')
        {
            if(inspace==0)
            {
                inspace=1;
                putchar(c);
            }
        }
        if(c!=' ')
        {
            inspace =0;
            putchar(c);
        }
    }
    getch();
}


Just copy and paste into your Microsoft Visual C++ or Turbo C (these are program developing software)
Or else you can try this demo file and use it ...
Click HERE to download this file.

(PRESS ctrl+z to end the program)..
~NOTE~ : While executing if you get any warning then just ignore it and continue with your program...



IF FACE ANY PROBLEM DON'T FORGET TO COMMENT ...!!

Don't Forget to share.... 

Follow on Facebook : Ethical Hacking.

No comments:

Post a Comment