Cod for reversing the string not working..i solved tought questions but this silly question is not producing correct result

question: reversing a string

answer:

only one loop require inner one
why you are using that for loop at line no 12 ??
remove this loop

Modified code