Tuesday, 19 August 2014

Remove Space In String Using C

#include
#include
#include

void main()
{
char a[80];
int i=0;
clrscr();
printf("Enter the string\n");
gets(a);
while(a[i]!='\0')
{
 for(;a[i]==' ';i++);
 {
for(;a[i]!=' '&&a[i]!='\0';i++)
printf("%c",a[i]);
}
printf("%c \n",a[i]);}
getch();
}

No comments:

Post a Comment