In this program, we are going to share how to find maximum element in array using C programming language. If you are a beginner and want to start learning the C programming, then keep your close attention in this tutorial as I am going to share a C program to find maximum element in array.
Copy the below C program and execute it with the help of C compiler. At the end of this program, We have shared the output of this program.
int array, maximum, size, c, location = 1;
printf("Enter the number of elements in array\n");
printf("Enter %d integers\n", size);
for (c = 0; c < size; c++)
maximum = array;
for (c = 1; c < size; c++)
if (array[c] > maximum)
maximum = array[c];
location = c+1;
printf("The maximum element is present at location %d and its value is %d.\n", location, maximum);
Enter the number of elements in array
Enter 5 integers
The maximum element is present at location 5 and its value is 23.
Tags: C Program to Find Largest Element in Array in C Programming, c program to find largest(maximum) number in array, C Program to Find Maximum Element in Array, c programs, c programs with output, c programs with solutions, list of important c programs, maximum element occurs in the array