A good Array Example

Hackerrank problem:

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

int main() {
    int n,inte,arr[10001];
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>inte;
        arr[i]=inte;
    }
    for(int j=n-1; j>=0; j--){
    printf("%d ",arr[j]);
    }
    return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published.