Arrays Introduction

  • + 0 comments

    Here is my solution to this without using pointers:

    int main() {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT */ 
        int size;
        cin >> size;
        int nums[size];
        for (int i = size - 1; i >= 0; i--) {
            cin >> nums[i];
        }
        for (int j = 0; j < size; j++){
            cout << nums[j] << " ";
        }
        
         
        return 0;
    }