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

Write a program that calculates points along a curve, write a program that ...

write a program that calculates points along a rhodonea curve.... ? int fillArray( double data[ ], int nValues, double min, double max ); o Used to fill in the theta array. Return

Describe the oops concept - class, There are so many different concepts rel...

There are so many different concepts related with OOP (Object-oriented programming) such as: Class Object Inheritance Polymorphism Abstraction Encapsulation

Operator overloading - c++ program, Operator overloading - c++ program: ...

Operator overloading - c++ program: Write a program in c to define operator overloading. class matrix{                   private :                 int x[2][2];

Explain binary logical bit-wise operators, Binary logical bit-wise operator...

Binary logical bit-wise operators  There are three logical bit-wise operators :                   &             and                 |              or

When are temporary variables formed by c++ compiler?, A: Provided that func...

A: Provided that function parameter is "const reference", compiler create temporary variable in following two ways. a) The actual argument is the correct type, however it isn't

Define difference among new & malloc?, Both malloc & new functions are util...

Both malloc & new functions are utilized for dynamic memory allocations & the basic difference is: malloc need a special "typecasting" while it allocates memory for eg. if the poin

Padovan string, write a javaprogram to solve padovan string using java? ...

write a javaprogram to solve padovan string using java? program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring;

Bubble sort, sample of program that use in bubble sort using assignment ope...

sample of program that use in bubble sort using assignment operator in c++

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