#include <stdio.h> #include <stdlib.h> void revers(char *s) {
if(*s) { revers(++s); s--; printf("%c ",*s); } } int main(int argc, char *argv[]) { char arr[]="string"; revers(arr); system("PAUSE"); return 0; } acording to above given definition of temporary variable will the above code also work for this question??? On Mon, Jun 27, 2011 at 11:56 PM, Swathi <chukka.swa...@gmail.com> wrote: > it works perfectly > > > On Mon, Jun 27, 2011 at 11:53 PM, hary rathor <harry.rat...@gmail.com>wrote: > >> this solution according to sameer statement solution if there is any >> problem then pls tell me . here string or char is not being >> store anywhere >> >> char * reverse(char *str,int i ,int j) >> { >> while(i<j) >> { >> >> str[i]=str[i]^str[j]; >> str[j]=str[i]^str[j]; >> str[i]=str[i]^str[j]; >> i++;j--; >> } >> return str; >> } >> >> int main () >> { >> char str[]="harish"; >> printf("%s",reverse(str,0,sizeof(str)-2)); >> return 0; >> >> } >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.