> ## Documentation Index
> Fetch the complete documentation index at: https://learn.acadlink.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Reverse an Array

> Print array elements in reverse order.

## Problem Statement

Write a C program that takes N integers as input and prints all elements in reverse order.

## Solution

```c theme={null}
#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    int arr[n];
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    for (int i = n - 1; i >= 0; i--)
        printf("%d ", arr[i]);
    printf("\n");
    return 0;
}
```

## Input

```
5
1 2 3 4 5
```

## Output

```
5 4 3 2 1
```
