THIS IS A PROGRAM WHICH WILL REPLACE MORE BLANK (IF PRESENT) WITH A SINGLE BLANK....
#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();
}
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...
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 ...!!
No comments:
Post a Comment