Write program to get largest element in array using function, C/C++ Programming

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

Posted Date: 6/13/2013 6:23:19 AM | Location : United States







Related Discussions:- Write program to get largest element in array using function, Assignment Help, Ask Question on Write program to get largest element in array using function, Get Answer, Expert's Help, Write program to get largest element in array using function Discussions

Write discussion on Write program to get largest element in array using function
Your posts are moderated
Related Questions
Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl



Classify computer systems according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also.

What are some guidelines / "rules of thumb" for overloading operators? A: Here are a few guidelines / rules of thumb .Use common sense. If your overloaded operator makes life si



A: Use operator overloading to present a friend right-shift operator, operator>>. It is similar to the output operator, except the parameter doesn't contain a const: "Fred&" instea

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

#include #include #include #include #include //*Variables Used in Programs*// int k; int l; int d; int won; int loss; int cash = 500;