Showing posts with label Array introduction solution. Show all posts
Showing posts with label Array introduction solution. Show all posts

Monday, December 28, 2020

Arrays Introduction | Hackerrank | C++ | Easy | Solution

Problem : https://www.hackerrank.com/challenges/arrays-introduction/problem

 Solution : 

#include <cmath>

#include <cstdio>

#include <vector>

#include <iostream>

#include <algorithm>

using namespace std;


void reverse(int A[],int size){

    for(int i = size -1 ;i>=0;i--){

        cout<<A[i]<<" ";

    }

}


int main() {

    /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 

    int size;

    cin>>size;

    int A[size];

    for(int i =0;i<size;i++){

        cin>>A[i];

    }

    

    reverse(A,size);

    return 0;

 

}