Second swap not working

Please check the code. The second swap where swap the elements of the reversered array is not working

at line no 37
it should be if not while
Modified Code

if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with :heart: and don’t forgot to mark doubt as resolved