#include <iostream>
#include <limits.h>
using namespace std;
void reverseArray(int arr[], int size){
int start = 0;
int end = size-1;
while(start <= end){
swap(arr[start], arr[end]);
start++;
end--;
}
cout << "\n\n<-- Array Reversed --> " << endl;
}
void printArray(int arr[], int size){
cout << "\nPrinting Array --> " << endl;
cout << " ";
for(int i=0; i<size; i++){
cout << arr[i] << " ";
}
}
int main() {
int size = 15;
int arr[size];
cout << "Enter Array Elements : " << endl;
for(int i=0; i<size; i++){
cin >> arr[i];
}
printArray(arr, size);
reverseArray(arr, size);
printArray(arr, size);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: