HI THERE, the code of the "removespaces" function is 100% CORRECT but it doesn't return the write answer, maybe there is a mistake in the main function:
#include<stdio.h>
void RemoveSpaces(char *s);
int main(){
char s[24];
printf("\n enter the double word :");
scanf("%s ",s);
RemoveSpaces(s);
printf(" \n %s",s);
}
void RemoveSpaces(char *s)
{
char temp[85];
int i,j=0;
strcpy(temp,s);
/* Get the length of the string.*/
i = strlen(temp);
/* Subtract one space for the "NULL" character. */
i--;
/* Back up until the first "non-space" character is encountered */
while(isspace(temp[i]))
i--;
/* Move past the first non-space*/
i++;
/* Close off the string at the new location with a "NULL" character. */
temp[i]='\0';
/* Copy the new shortened string over the old one. */
strcpy(s,temp);
}