> ## 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.

# Sum of Array Using Pointer

> Traverse an array using pointer arithmetic and find the sum.

## Problem Statement

Write a C program to find the sum of array elements by traversing the array using pointer arithmetic.

## Solution

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

int main() {
    int arr[] = {1, 2, 3, 4, 5};
    int *p = arr;
    int sum = 0, n = 5;
    for (int i = 0; i < n; i++) sum += *(p + i);
    printf("Sum = %d\n", sum);
    return 0;
}
```

## Output

```
Sum = 15
```
