I have 1 more solution :- #include<stdio.h> #include<string.h>
main() { int i,j,l; char arr[100]; printf("Enter the string\n"); fgets(arr,100,stdin); for(i=0,l=strlen(arr),j=l;i<=l/2;i++) { arr[j--]=arr[i]; arr[i]=arr[j]; } for(i--;i<l;i++) arr[i]=arr[i+1]; arr[i]='\0'; printf("%s\n",arr); } I hope it will work perfect :) 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 SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- 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.