Try this one...
#includestdio.h
#includestring.h
void reverse(char *p,char*q)
{
char c;
while(pq)
{
c=*p;*p=*q;*q=c;
p++;
q--;
}
}
int main()
{
char A[50];
printf(\n Enter a String:\n\n);
gets(A);
int len=strlen(A);
//Reverse String word by word
// if string is :- I am a good boy
//output string should be :- boy good a am I
#includestdio.h
#includestring.h
void reverse(char *p,char*q)
{
int i;char c;
while(pq)
{
c=*p;*p=*q;*q=c;
p++;
q--;
}
}
void
u shud do TWO things in..your reverseword function..
first is str[i]=='\0' and not str[i]='\0'
second is while(i=len) and not while(ilen)
On Sun, Sep 25, 2011 at 6:49 AM, Deoki Nandan deok...@gmail.com wrote:
//Reverse String word by word
// if string is :- I am a good boy
//output string