answersLogoWhite

0


Best Answer

int max(int arr[], int arrSize)
{
int maximum = arr[0];
for (int i = 0; i < arrSize; i++)
{
if (maximum < arr[i])
{
maximum = arr;

}

}

return maximum;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a function in c that returns the largest value stored in an array-of-int Test the function in a simple program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What module returns a value back to the part of the program that called it?

A function. You can have a function that returns but doesn't return a value with it.


What is the function that returns the largest value in a set of values?

MAX


When function returns a value the entire function call can be assigned a variable?

AnswerYes, it can. For instance, if your function returns double you can assign the function call to a variable of type double.AnswerNo, only the returned value, of course.


What is function in oop?

A function is a block of code that has a name and it has a property that it is reusable i.e. it can be executed from as many different points in a C Program as required.Function groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities - called functions in C - to get its tasks done. A function is a self contained block of statements that perform a coherent task of same kindThe name of the function is unique in a C Program and is Global. It neams that a function can be accessed from any location with in a C Program. We pass information to the function called arguments specified when the function is called. And the function either returns some value to the point it was called from or returns nothing.We can divide a long C program into small blocks which can perform a certain task. A function is a self contained block of statements that perform a coherent task of same kind.Structure of a FunctionThere are two main parts of the function. The function header and the function body.int sum(int x, int y){int ans = 0; //holds the answer that will be returnedans = x + y; //calculate the sumreturn ans //return the answer}


What is the lifetime of local variables in a function?

If the variable is local to the function it exists until the function returns.

Related questions

What module returns a value back to the part of the program that called it?

A function. You can have a function that returns but doesn't return a value with it.


What is the function that returns the largest value in a set of values?

MAX


What is a named operation that returns a value in the Excel program used to simplify formulas?

A function.


Can you write a program without specifying the prototype of any function?

You can write a program without specifying its prototype when the function returns an integer.If the prototype is not mentioned the compiler thinks that the return type of the function used is integer.When making program which return integer you can ignore writing the protoype.


What is the difference between simple program and function in C?

A function is a piece of code that has no or more arguments, that returns no or one value. A program is code that implements the function int main(int argc, char** argv). As such, a function and a program are the same, but the program also includes compiler directives to "include" other things, such as standard headers, i.e. #include .


A function takes the exponential function's output and returns the exponential function's input?

A __________ function takes the exponential function's output and returns the exponential function's input.


Why is returning a pointer to a local variable a logical error?

Local variables automatically fall from scope when a function returns. If the function returns a pointer to one of its local variables and you subsequently attempt to dereference that pointer, you introduce undefined behaviour into your program. With undefined behaviour you have no way of knowing what will happen: the program may work; the program may crash; the program may wipe the user's hard-drive. Anything can happen when you introduce undefined behaviour into a program.


How does the highvalue function in Excel work?

Excel does not have a HIGHVALUE function. It does have a MAX function that finds the largest number in a range.The MAX function returns the largest value from the numbers provided.MAX(number1,number2,...number_n)number1, number2, ... number_n are numeric values - they can be numbers, named ranges, arrays, or references to numbers. There can be up to 30 values entered.


What is the meaning of fabs in quadratic equation in c program?

In the C Programming Language, the fabs function returns the absolute value of a floating-point number


What is the difference between min and max function?

The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)The MIN function returns the lowest value from a set of values. The MAX function returns the highest value from a set of values.=MIN(A2:A20)=MAX(A2:A20)


What is a function in VB.net?

A function is an algorithm that returns a value when it is executed


A function prime that returns if its argument is a prime no or returns zero?

prime number