Write a program to get the largest element in an array using Function?
# include
int largest(int b[],int);
main()
{
int lar,a[5]={12,2,36,40,5};
lar=largest(a,n);
printf("%d",lar);
}
int largest(int b[],int num)
{
int i,max;
max=b[0];
for(i=1;i {
if(b[i]>max)
{
max=b[i];
}
}
return max;
}