You are given a list of N integers and you need to reverse it and print the reversed list in a new line.


You are given a list of N integers and you need to reverse it and print the reversed list in a new line.






OURSHOPKEEPER








#include <iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int a[n];
    for (int i = 0i < ni++)
    {
        cin >> a[i];
    }
    for (int i = n-1i >= 0i--)
    {
        cout << a[i]<<" ";
    }
}




    


Click on the above button to download the code.



Post a Comment

If you have furthur QUERIES please let us know

Previous Post Next Post