#include<stdio.h> void my_reverse(int len ,char arr[]) { int left =0; int right = len -1; while(left < right) { char tmp = arr[left]; arr[left] = arr[right]; arr[right] =tmp; left ++; right --; } } int main() { char arr[] = "tneduts a ma i"; int len =sizeof(arr)/sizeof(arr[0])-1; my_reverse(len,arr); printf("%s\n",arr); return 0; }