MY one test case is failing…why??
#include
using namespace std;
void reversearr(int a[], int begin, int end)
{
while (end > begin)
{
int start = a[begin];
a[begin] = a[end];
a[end] = start;
begin++;
end–;
}
}
void printarr(int a[] , int n){
for (int i = 0; i < n; i++)
{
cout<<a[i];
}
}
int main()
{
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
{
cin>>a[i];
}
reversearr(a , 1 , n-1);
printarr(a , n);
return 0;
}