#include<stdio.h>
int main()
{
char s[20],t[30],*p,*q;
scanf("%s",s);
p=s;
q=t;
while(*(++p)!='\0');
p--;
while(p!=s)
{
*(q++)=*(p--);
}
*q='\0';
}
Is this what you are looking for?
I think an inplace solution is required?
On Sat, May 28, 2011 at 4:10 PM, abc abc <[email protected]> wrote:
> *Given an array of characters. How would you reverse it. ? How would you
> reverse it without using indexing in the array.*
> *
> *
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.