In this HackerRank Array Introduction problem in c++ we need to develop a program in which we have given an array of N integers and you have to print the integers in the reverse order.

HackerRank Arrays Introduction in C++ problem solution

 

HackerRank Arrays Introduction in C++ problem solution

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
int n,i;
cin >> n;
int a[n];
int b[n];
   
for(i = 0;i<n;i++){
cin >> a[i];
}
for(i = n-1;i>=0;i--){
cout << a[i] << " ";
}
  
    return 0;
}