#include ctype.h
#include string.h
int main(int argc, char* argv[])
{
char line[500];
char tmp[500];
char *words[100];
int wordCount = 0;
char *p, *wordStart=0;
printf(Enter string:);
fgets(line,500,stdin);
for(p = line; *p; ++p)
First reverse the whole sentence and then reverse every word of the
sentence
Example : I am a programmer
Step 1 Reverse entire sentence
remmargorp a ma I
Step 2 Now reverse every word in a sentence
programmer a am I
Complexity O(n)
On Mon, Aug 15, 2011 at 10:22 PM, Don dondod...@gmail.com