Can you tell whats wrong with my code while reversing the array.
Problem in reversing array
Why do you want to reverse the array? This problem can be done without reversing the array
Also the logic that you have applied in your code is incorrect. However there is no error in the reverse array function, that is perfectly fine. But what you have done is not what the question requires