1#include<stdio.h>
2
3char *remove_white_spaces(char *str)
4{
5 int i = 0, j = 0;
6 while (str[i])
7 {
8 if (str[i] != ‘ ‘)
9 str[j++] = str[i];
10 i++;
11 }
12 str[j] = ‘\0’;
13 return str;
14}
15
16int main()
17{
18 char str[50];
19 printf("\n\t Enter a string : ");
20 gets(str);
21 remove_white_spaces(str);
22 printf(“%s”,str);
23 return 0;
24}