#include <stdio.h>

#include <string.h>

char* rev(char* str)

{

int end= strlen(str)-1;

int start = 0; while( start<end )

{

str[start] ^= str[end];

str[end] ^= str[start];

str[start]^= str[end];

++start; --end; } return str;

}

int main()

{

char str[50]="Reversing a string using XOR";

puts(rev(str));

}