Header Ads Widget

Responsive Advertisement

Remove Spaces Form The Text..

 


#include<stdio.h>
#include <string.h>
int main()
{
    char arr[1000];
    int i, length,j;

    printf("Enter A Line With Space : ");
    fgets(arr,1000,stdin);
    for(i=0; i<strlen(arr); i++)
    {
        if(arr[i]==' ')
        {
            for(j=i; j<strlen(arr); j++)
            {
                arr[j]=arr[j+1];
            }
        }
    }
    printf("The New Line Without Space is : ");
    puts(arr);
    return 0;
}


Post a Comment

0 Comments