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

Assignment Help:

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


Related Discussions:- Write program to get largest element in array using function

I want a reverse engineer a .exe to obtain the code, I want a Reverse engin...

I want a Reverse engineer a .exe to obtain the code Project Description: I'd like to get the full C++ source code from a .exe please Skills required is C++ Programming

Working a homework programming assignment in C++, I am working on a program...

I am working on a program that allows a player to play a game against the computer. In this game the player can only chose to draw 1, 2, or 3 toothpicks. How do I make restrictions

Prob, Given an integer n and a permutation of numbers 1, 2 ... , n-1, n wri...

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Described the isa and hasa class relationships. , Described the ISA and HAS...

Described the ISA and HASA class relationships. How would you apply each in a class design? A: A specialized class "is" specialization of another class and, thus, has the ISA re

Explain hiding overloaded functions, Hiding overloaded functions We can...

Hiding overloaded functions We cannot overload a base class function by redefining it in a derived class with a dissimilar argument list. Consider examples to see if similar fu

Example for external storage class - computer programming, Example for exte...

Example for external storage class - computer programming? extern double sin (double); In a function prototype, for the sin() function its function definition ~ we can write

Illustration of grid function, Illustration of Grid function: For illu...

Illustration of Grid function: For illustration, the script below creates two individual figure windows. At First, it clears the figure window. Then, it generates an x vector

Program to calculate average of marks, Program for calculate average of tot...

Program for calculate average of total marks: #include using namespace std; void print(int marks_arr[],int cnt) { int ind[cnt]; int i=0; int j=0; int k=0;

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd