Here is my simple logic... i really don kno if it works (hehehhhe )
#include
#include
main()
{
char *q = "this is a man";
char *a,*b,c[10][25];
int l = 0,i,j = 0,k;
clrscr();
a = q;
b = q;
while(*a != '\0')
{
b++;
a++;
if(*b == ' ')
{
a++;
*b = '\0';
b++;
l++;
}
}
a = q;
for(i = 0;i <= e;i++)
{
while(c[j++] = *a++);
j = 0;
}
for(k = l;k >= 0;k--)
printf("%s ",c[k]);
getch();
return(0);
}
i think this is the sol'n , but if i m wrong please tell me .
No comments:
Post a Comment