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

# Largest Element

> Find the largest element in an array.

## Problem Statement

Write a C program that takes N integers as input and finds the largest element in the array.

## 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]);
    int max = arr[0];
    for (int i = 1; i < n; i++)
        if (arr[i] > max) max = arr[i];
    printf("Largest = %d\n", max);
    return 0;
}
```

## Input

```
5
3 7 1 9 4
```

## Output

```
Largest = 9
```
