C Programming Code Examples C > Arrays and Matrices Code Examples Program to find largest array element in C Program to find largest array element in C Finding largest value in an array is a classic C array program. This program gives you an insight of iteration, array and conditional operators. We iteratively check each element of an array if it is the largest. #include <stdio.h> int main() { int array[10] = {4, 8, 5, 3, 1, 2, 6, 8, 9, 0}; int loop, largest; largest = array[0]; for(loop = 1; loop < 10; loop++) { if( largest < array[loop] ) largest = array[loop]; } printf("Largest element of array is %d", largest); return 0; } procedure largest_array(A) Declare largest as integer Set largest to 0 FOR EACH value in A DO IF A[n] is greater than largest THEN largest = A[n] ENDIF END FOR Display largest end procedure