Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void recursiveArrayReverse(int arr[], int size)
- {
- if (size != 0)
- {
- cout << arr[size - 1] << " ";
- recursiveArrayReverse(arr, size - 1);
- }
- }
- int main()
- {
- int arraySize;
- cout << "Enter Array Size: " << endl;
- cin >> arraySize;
- int *arr = new int[arraySize];
- for (int n = 0; n < arraySize; n++)
- {
- cout << "\nEnter Content Number #" << (n + 1) << endl;
- cin >> arr[n];
- }
- cout << "\nReverse Order: " << endl;
- recursiveArrayReverse(arr, arraySize);
- return 0;
- }
Add Comment
Please, Sign In to add comment