State a statement in algorithm program (selection)and write a program

Statement: Find the largest element in an array using the selection sort algorithm.

Program:

```
# Function to find the largest element in an array
def find_largest(arr):
n = len(arr)

# Traverse through the array
for i in range(n):
max_idx = i

# Find the index of the maximum element
for j in range(i+1, n):
if arr[j] > arr[max_idx]:
max_idx = j

# Swap the maximum element with the current element
arr[i], arr[max_idx] = arr[max_idx], arr[i]

# Return the largest element
return arr[0]

# Test the program
arr = [29, 14, 71, 5, 42]
largest = find_largest(arr)
print("The largest element is:", largest)
```

This program implements the selection sort algorithm to find the largest element in an array. The algorithm works by repeatedly finding the maximum element from the unsorted portion of the array and swapping it with the first element of the unsorted portion. The largest element is returned as the output. In the given program, the array [29, 14, 71, 5, 42] is used as a test case, and the program prints "The largest element is: 71".