write a program to get the largest element in an


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;
}

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: write a program to get the largest element in an
Reference No:- TGS0305083

Expected delivery within 24 Hours