Arrays Introduction

Sort by

recency

|

1336 Discussions

|

  • + 0 comments
        int n,i;
        cin>>n;
        int arr[n-1];
        
        for(i =0;i < n;i++)
        cin>>arr[i];
        
        for(n = n-1;n>=0;n--)
        cout<<arr[n]<<" ";
        return 0;
    
  • + 0 comments

    include

    include

    include

    include

    include

    using namespace std;

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

  • + 0 comments

    include

    using namespace std;

    int main() { int n; cin>>n; int arr[n]; for(int i=0;i>arr[i]; }

    for(int i=n;i>0;i--)
    {
        cout<<arr[i-1]<<" ";
    }
    
    
    
    return 0;
    

    }

  • + 0 comments

    Constraints

    1 <= N <= 1000

    1 <= A[i] <= 10000, where A[i] is the i'th integer in the array.

    Why is anyone not coding as per the constraints?

  • + 0 comments

    include

    using namespace std;

    int main() { int n; cin >> n; int arr[n];

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

    }