Bhuvan InfoTech Android App

Download our Android App and browse Technical News, Projects, Computer Tricks more easily with lots of Interesting Features.

Tuesday, June 14, 2016

Find largest Element of array | C program


#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:

Amazing Deal !