DXC Technology Interview Question

Write a code to reverse the string