Q: Write a function that reverse the words in the sentence ,for example  "This is a string "   becomes  "string a is This".
 

A:


SimpleLogic(char myStr[]) // pass the string
{
char *t=myStr;
while(*t)
if(*t==' ')
*t++='\0';
else
++t;

--t;

while(t>myStr)
if(*t=='\0')
--t;
else
printf("%s\n",(t-- + 1));


printf("%s",myStr);
}