Remove Extra Space in String C Program Tamil


#include<stdio.h>
#include<conio.h>
void main()
{
    int i=0,j=0;
    char a[100],b[100];
    clrscr();
    printf("\nEnter the string : ");
    gets(a);
    while(a[i]!='\0')
    {
      if(a[i]!=' '||a[i+1]!=' ')
      {
	b[j]=a[i];
	j++;
      }
      i++;
    }
    b[j]='\0';
    printf("\nAfter removing : %s",b);
    getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming