#include <stdio.h>
int main()
{
int array[50], s, i, lar;
printf("\n Enter the size of the array: ");
scanf("%d", &s);
printf("\n Enter %d elements of the array: ", size);
for (i = 0; i < s; i++)
scanf("%d", &array[i]);
lar = array[0];
for (i = 1; i < s; i++)
{
if (lar < array[i])
lar = array[i];
}
printf("\n largest element present in the given array is : %d", lar);
return 0;
}
Bhuvan Arora
No comments:
Post a Comment