REVERSE AN ARRAY

PHOTO EMBED

Tue Aug 08 2023 19:44:50 GMT+0000 (Coordinated Universal Time)

Saved by @itsAnkiy #arr #duplicate #search

#include <iostream>
using namespace std;

int main() {
    //Write your code here
    int n;
    cin>>n;

    int* arr = new int [n];

    for(int i = 0; i < n; i++){
        cin>>arr[i];
    }
    for(int i = n-1 ; i >= 0; i--){
        cout<<arr[i]<<" ";
    }

    return 0;
}
content_copyCOPY

/*Problem Statement Given an array with N elements, the task is to reverse all the array elements and print the reversed array. Sample Input: 8 7 5 2 11 2 43 1 10 Sample Output: 10 1 43 2 11 2 5 7 Explanation Of Sample Input: Here the elements have been reversed. */