C Program to findlargest of n numbers using Array

C Program to find the largest of n numbers using Array

We can write a C Program to find largest among n numbers using Array. For example:  if we  given 7 input  numbers as  65, 76, 54, -98, 35, 23, 93, then  the largest of 7 numbers using Array is 93. The below given C program will find the largest (biggest, greatest or highest or maximum) of n numbers using array.  Kindly check out the program to find the largest (biggest, greatest or highest or maximum) of n integers. The questions to find the largest (biggest, greatest or highest or maximum) of n numbers can be asked as

1). C Program to find Largest element in array in C programming
2). C program to find maximum element in array
3). C Program to find Largest number in an Array
4). C Program to find Largest element from the array
5). C Program to Find maximum element in an Array
6). C Program to Find Largest Element of an Array
7). Finding the Largest number in an array of integers
8). C program to find the Largest integer in a list of integers

largest (biggest or greatest or highest or maximum) of n numbers (Using Array)Program

#include<stdio.h>
#include<math.h>
int main(){
int n, z, large, array[20];
printf(" How many Integer numbers : ");
scanf("%d", &n);
z=n;
if(n>0){
printf("\n Enter the numbers one by one : ");
for(;n>=1;n--)
scanf("%d", &array[n]);
large = array[1];
n=z;
for(;n>=1; n--){
if(large < array[n])
large = array[n];
}
}
printf("\n The largest of %d numbers is %d", z, large);
return(0);
}

Sample Output:

How many Integer numbers : 10
Enter the numbers one by one : 56 93 45 24 95 16 -47 29 99 31
The largest of 10 numbers is 99