Skip to content

Commit

Permalink
my changes
Browse files Browse the repository at this point in the history
  • Loading branch information
i-tanuj authored Oct 17, 2019
1 parent 4aa606b commit cabdc44
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Arrays Introduction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//https://www.hackerrank.com/challenges/arrays-introduction/submissions/code/125864233

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


int main() {
int n,i,j,temp;
int arr[1000];
cin>>n;
for(i=0;i<n;i++)
{
cin>>arr[i];
}
j=i-1;
i=0;
while(i<j)
{
temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
i++;
j--;
}
for(i=0; i<n; i++)
{
cout<<arr[i]<<" ";
}
return 0;
}

0 comments on commit cabdc44

Please sign in to comment.