Traverse the string in the reversed manner
int j = bstr . length - 1 ; for ( int i = 0 ; i < bstr . length / 2 ; i ++ ) { char temp = bstr [ i ] ; bstr [ i ] = bstr [ j ] ; bstr [ j ] = temp ; j -- ; } for ( char x : bstr ) { int q ;