Error in the program


sorry previously I had given program to you
this id that hackerblock problem
https://hack.codingblocks.com/app/practice/3/100/problem

hello @sraj39273

#include <iostream>
using namespace std;
int main() {
    int a[1000];
    a[1000]={0};
  
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        int j=n-1;
        while(i<j){
            swap(a[i],a[j]);
            i++;
            j--;
        }
    }
for(int i=0;i<n;i++){
    cout<a[i];
}
return 0;
}

this is the program that u shared this time. again it is is wrong u r given a single number, u cant read it like array.
pls referr previous thread for correct approach.

or if u have different code then pls share it with me

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.