#includevoid reverse(char* line) { int index=0; char temp[20]; char* swi; swi = line; while (*swi) { if (*swi == ' ') { swi++; continue; } else { temp[index] = *swi; swi++; index++; } } temp[index] = ' '; puts(temp); index = 0; while (*(temp + index) != ' ') { *(line+index) = *(temp + index); index++; } *(line + index) = ' '; } int main() { char a[20]; char* b; printf("please enter a line of characters:"); b = gets(a); while (a[0] != ' ') { reverse(b); puts(b); printf("Next line?(blank to quit)"); b = gets(a); } printf("bye"); }



