किसी सरणी के तत्वों को उलटने के लिए C++ प्रोग्राम लिखें।
#include <iostream>
using namespace std;

int main() {
   int arr[100], n, i, temp;
   
   cout << "Enter the number of elements in array: ";
   cin >> n;
   
   cout << "Enter elements:" << endl;
   for(i = 0; i < n; i++){
      cin >> arr[i];
   }
   
   // swapping elements
   for(i = 0; i < n/2; i++){
      temp = arr[i];
      arr[i] = arr[n-i-1];
      arr[n-i-1] = temp;
   }
   
   cout << "Array after reversing:" << endl;
   for(i = 0; i < n; i++){
      cout << arr[i] << " ";
   }
   return 0;
}